Skip to content

Commit 004e03d

Browse files
[AutoPR- Security] Patch glib for CVE-2026-1484 [LOW] (#15650)
1 parent 4cdf058 commit 004e03d

File tree

6 files changed

+112
-13
lines changed

6 files changed

+112
-13
lines changed

SPECS/glib/CVE-2026-1484.patch

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
From fe3ce5d676a1b64a6fe071b21119e06a7ccb7046 Mon Sep 17 00:00:00 2001
2+
From: Marco Trevisan <mail@3v1n0.net>
3+
Date: Fri, 23 Jan 2026 18:48:30 +0100
4+
Subject: [PATCH 1/2] gbase64: Use gsize to prevent potential overflow
5+
MIME-Version: 1.0
6+
Content-Type: text/plain; charset=UTF-8
7+
Content-Transfer-Encoding: 8bit
8+
9+
Both g_base64_encode_step() and g_base64_encode_close() return gsize
10+
values, but these are summed to an int value.
11+
12+
If the sum of these returned values is bigger than MAXINT, we overflow
13+
while doing the null byte write.
14+
15+
Spotted by treeplus.
16+
Thanks to the Sovereign Tech Resilience programme from the Sovereign
17+
Tech Agency.
18+
19+
ID: #YWH-PGM9867-168
20+
Closes: #3870
21+
22+
(cherry picked from commit 6845f7776982849a2be1d8c9b0495e389092bff2)
23+
24+
Co-authored-by: Marco Trevisan (Treviño) <mail@3v1n0.net>
25+
---
26+
glib/gbase64.c | 3 ++-
27+
1 file changed, 2 insertions(+), 1 deletion(-)
28+
29+
diff --git a/glib/gbase64.c b/glib/gbase64.c
30+
index 3c427f8..60c8560 100644
31+
--- a/glib/gbase64.c
32+
+++ b/glib/gbase64.c
33+
@@ -264,8 +264,9 @@ g_base64_encode (const guchar *data,
34+
gsize len)
35+
{
36+
gchar *out;
37+
- gint state = 0, outlen;
38+
+ gint state = 0;
39+
gint save = 0;
40+
+ gsize outlen;
41+
42+
g_return_val_if_fail (data != NULL || len == 0, NULL);
43+
44+
--
45+
2.45.4
46+
47+
48+
From e9754df0897c47f2b5a6fe2a65e6facf362ee614 Mon Sep 17 00:00:00 2001
49+
From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= <mail@3v1n0.net>
50+
Date: Wed, 21 Jan 2026 20:09:44 +0100
51+
Subject: [PATCH 2/2] gbase64: Ensure that the out value is within allocated
52+
size
53+
54+
We do not want to deference or write to it
55+
56+
Related to: #3870
57+
58+
Signed-off-by: Azure Linux Security Servicing Account <azurelinux-security@microsoft.com>
59+
Upstream-reference: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/4979.patch
60+
---
61+
glib/gbase64.c | 8 +++++++-
62+
1 file changed, 7 insertions(+), 1 deletion(-)
63+
64+
diff --git a/glib/gbase64.c b/glib/gbase64.c
65+
index 60c8560..0827e83 100644
66+
--- a/glib/gbase64.c
67+
+++ b/glib/gbase64.c
68+
@@ -267,6 +267,7 @@ g_base64_encode (const guchar *data,
69+
gint state = 0;
70+
gint save = 0;
71+
gsize outlen;
72+
+ gsize allocsize;
73+
74+
g_return_val_if_fail (data != NULL || len == 0, NULL);
75+
76+
@@ -274,10 +275,15 @@ g_base64_encode (const guchar *data,
77+
+1 is needed for trailing \0, also check for unlikely integer overflow */
78+
g_return_val_if_fail (len < ((G_MAXSIZE - 1) / 4 - 1) * 3, NULL);
79+
80+
- out = g_malloc ((len / 3 + 1) * 4 + 1);
81+
+ allocsize = (len / 3 + 1) * 4 + 1;
82+
+ out = g_malloc (allocsize);
83+
84+
outlen = g_base64_encode_step (data, len, FALSE, out, &state, &save);
85+
+ g_assert (outlen <= allocsize);
86+
+
87+
outlen += g_base64_encode_close (FALSE, out + outlen, &state, &save);
88+
+ g_assert (outlen <= allocsize);
89+
+
90+
out[outlen] = '\0';
91+
92+
return (gchar *) out;
93+
--
94+
2.45.4
95+

SPECS/glib/glib.spec

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Summary: Low-level libraries useful for providing data structure handling for C.
33
Name: glib
44
Version: 2.78.6
5-
Release: 6%{?dist}
5+
Release: 7%{?dist}
66
License: LGPLv2+
77
Vendor: Microsoft Corporation
88
Distribution: Azure Linux
@@ -17,6 +17,7 @@ Patch4: CVE-2025-7039.patch
1717
Patch5: CVE-2025-13601.patch
1818
Patch6: CVE-2025-14087.patch
1919
Patch7: CVE-2025-14512.patch
20+
Patch8: CVE-2026-1484.patch
2021
BuildRequires: cmake
2122
BuildRequires: gtk-doc
2223
BuildRequires: libffi-devel
@@ -130,6 +131,9 @@ touch %{buildroot}%{_libdir}/gio/modules/giomodule.cache
130131
%doc %{_datadir}/gtk-doc/html/*
131132

132133
%changelog
134+
* Mon Feb 02 2026 Azure Linux Security Servicing Account <azurelinux-security@microsoft.com> - 2.78.6-7
135+
- Patch for CVE-2026-1484
136+
133137
* Mon Dec 15 2025 Azure Linux Security Servicing Account <azurelinux-security@microsoft.com> - 2.78.6-6
134138
- Patch for CVE-2025-14087, CVE-2025-14512
135139

toolkit/resources/manifests/package/pkggen_core_aarch64.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ libxml2-devel-2.11.5-8.azl3.aarch64.rpm
208208
docbook-dtd-xml-4.5-11.azl3.noarch.rpm
209209
docbook-style-xsl-1.79.1-14.azl3.noarch.rpm
210210
libsepol-3.6-2.azl3.aarch64.rpm
211-
glib-2.78.6-6.azl3.aarch64.rpm
211+
glib-2.78.6-7.azl3.aarch64.rpm
212212
libltdl-2.4.7-1.azl3.aarch64.rpm
213213
libltdl-devel-2.4.7-1.azl3.aarch64.rpm
214214
lua-5.4.6-1.azl3.aarch64.rpm

toolkit/resources/manifests/package/pkggen_core_x86_64.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ libxml2-devel-2.11.5-8.azl3.x86_64.rpm
208208
docbook-dtd-xml-4.5-11.azl3.noarch.rpm
209209
docbook-style-xsl-1.79.1-14.azl3.noarch.rpm
210210
libsepol-3.6-2.azl3.x86_64.rpm
211-
glib-2.78.6-6.azl3.x86_64.rpm
211+
glib-2.78.6-7.azl3.x86_64.rpm
212212
libltdl-2.4.7-1.azl3.x86_64.rpm
213213
libltdl-devel-2.4.7-1.azl3.x86_64.rpm
214214
lua-5.4.6-1.azl3.x86_64.rpm

toolkit/resources/manifests/package/toolchain_aarch64.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,11 @@ gdbm-lang-1.23-1.azl3.aarch64.rpm
122122
gettext-0.22-1.azl3.aarch64.rpm
123123
gettext-debuginfo-0.22-1.azl3.aarch64.rpm
124124
gfortran-13.2.0-7.azl3.aarch64.rpm
125-
glib-2.78.6-6.azl3.aarch64.rpm
126-
glib-debuginfo-2.78.6-6.azl3.aarch64.rpm
127-
glib-devel-2.78.6-6.azl3.aarch64.rpm
128-
glib-doc-2.78.6-6.azl3.noarch.rpm
129-
glib-schemas-2.78.6-6.azl3.aarch64.rpm
125+
glib-2.78.6-7.azl3.aarch64.rpm
126+
glib-debuginfo-2.78.6-7.azl3.aarch64.rpm
127+
glib-devel-2.78.6-7.azl3.aarch64.rpm
128+
glib-doc-2.78.6-7.azl3.noarch.rpm
129+
glib-schemas-2.78.6-7.azl3.aarch64.rpm
130130
glibc-2.38-18.azl3.aarch64.rpm
131131
glibc-debuginfo-2.38-18.azl3.aarch64.rpm
132132
glibc-devel-2.38-18.azl3.aarch64.rpm

toolkit/resources/manifests/package/toolchain_x86_64.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,11 @@ gdbm-lang-1.23-1.azl3.x86_64.rpm
129129
gettext-0.22-1.azl3.x86_64.rpm
130130
gettext-debuginfo-0.22-1.azl3.x86_64.rpm
131131
gfortran-13.2.0-7.azl3.x86_64.rpm
132-
glib-2.78.6-6.azl3.x86_64.rpm
133-
glib-debuginfo-2.78.6-6.azl3.x86_64.rpm
134-
glib-devel-2.78.6-6.azl3.x86_64.rpm
135-
glib-doc-2.78.6-6.azl3.noarch.rpm
136-
glib-schemas-2.78.6-6.azl3.x86_64.rpm
132+
glib-2.78.6-7.azl3.x86_64.rpm
133+
glib-debuginfo-2.78.6-7.azl3.x86_64.rpm
134+
glib-devel-2.78.6-7.azl3.x86_64.rpm
135+
glib-doc-2.78.6-7.azl3.noarch.rpm
136+
glib-schemas-2.78.6-7.azl3.x86_64.rpm
137137
glibc-2.38-18.azl3.x86_64.rpm
138138
glibc-debuginfo-2.38-18.azl3.x86_64.rpm
139139
glibc-devel-2.38-18.azl3.x86_64.rpm

0 commit comments

Comments
 (0)