Skip to content

Commit 32d029a

Browse files
authored
[LOW] Patch glib for CVE-2026-1484 (#15774)
1 parent 132e58d commit 32d029a

6 files changed

Lines changed: 84 additions & 13 deletions

File tree

SPECS/glib/CVE-2026-1484.patch

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
From 5ba0ed9ab2c28294713bdc56a8744ff0a446b59c 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+
[PATCH 2/2] gbase64: Ensure that the out value is within allocated
6+
MIME-Version: 1.0
7+
Content-Type: text/plain; charset=UTF-8
8+
Content-Transfer-Encoding: 8bit
9+
10+
Both g_base64_encode_step() and g_base64_encode_close() return gsize
11+
values, but these are summed to an int value.
12+
13+
If the sum of these returned values is bigger than MAXINT, we overflow
14+
while doing the null byte write.
15+
16+
Spotted by treeplus.
17+
Thanks to the Sovereign Tech Resilience programme from the Sovereign
18+
Tech Agency.
19+
20+
ID: #YWH-PGM9867-168
21+
Closes: #3870
22+
23+
24+
(cherry picked from commit 6845f7776982849a2be1d8c9b0495e389092bff2)
25+
Upstream Patch reference: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/4979.patch
26+
27+
Co-authored-by: Marco Trevisan (Treviño) <mail@3v1n0.net>
28+
---
29+
glib/gbase64.c | 11 +++++++++--
30+
1 file changed, 9 insertions(+), 2 deletions(-)
31+
32+
diff --git a/glib/gbase64.c b/glib/gbase64.c
33+
index f2d110e..19f8e5e 100644
34+
--- a/glib/gbase64.c
35+
+++ b/glib/gbase64.c
36+
@@ -262,8 +262,10 @@ g_base64_encode (const guchar *data,
37+
gsize len)
38+
{
39+
gchar *out;
40+
- gint state = 0, outlen;
41+
+ gint state = 0;
42+
gint save = 0;
43+
+ gsize outlen;
44+
+ gsize allocsize;
45+
46+
g_return_val_if_fail (data != NULL || len == 0, NULL);
47+
48+
@@ -271,10 +273,15 @@ g_base64_encode (const guchar *data,
49+
+1 is needed for trailing \0, also check for unlikely integer overflow */
50+
g_return_val_if_fail (len < ((G_MAXSIZE - 1) / 4 - 1) * 3, NULL);
51+
52+
- out = g_malloc ((len / 3 + 1) * 4 + 1);
53+
+ allocsize = (len / 3 + 1) * 4 + 1;
54+
+ out = g_malloc (allocsize);
55+
56+
outlen = g_base64_encode_step (data, len, FALSE, out, &state, &save);
57+
+ g_assert (outlen < allocsize);
58+
+
59+
outlen += g_base64_encode_close (FALSE, out + outlen, &state, &save);
60+
+ g_assert (outlen < allocsize);
61+
+
62+
out[outlen] = '\0';
63+
64+
return (gchar *) out;
65+
--
66+
2.45.4
67+

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.71.0
5-
Release: 10%{?dist}
5+
Release: 11%{?dist}
66
License: LGPLv2+
77
Vendor: Microsoft Corporation
88
Distribution: Mariner
@@ -21,6 +21,7 @@ Patch7: CVE-2025-14087.patch
2121
Patch8: CVE-2025-14512.patch
2222
Patch9: CVE-2026-1489.patch
2323
Patch10: CVE-2026-0988.patch
24+
Patch11: CVE-2026-1484.patch
2425
BuildRequires: cmake
2526
BuildRequires: gtk-doc
2627
BuildRequires: libffi-devel
@@ -134,6 +135,9 @@ touch %{buildroot}%{_libdir}/gio/modules/giomodule.cache
134135
%doc %{_datadir}/gtk-doc/html/*
135136

136137
%changelog
138+
* Thu Feb 12 2026 Archana Shettigar <v-shettigara@microsoft.com> - 2.71.0-11
139+
- Patch for CVE-2026-1484
140+
137141
* Thu Feb 05 2026 Azure Linux Security Servicing Account <azurelinux-security@microsoft.com> - 2.71.0-10
138142
- Patch for CVE-2026-1489, CVE-2026-0988
139143

toolkit/resources/manifests/package/pkggen_core_aarch64.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ libxml2-devel-2.10.4-11.cm2.aarch64.rpm
199199
docbook-dtd-xml-4.5-11.cm2.noarch.rpm
200200
docbook-style-xsl-1.79.1-14.cm2.noarch.rpm
201201
libsepol-3.2-2.cm2.aarch64.rpm
202-
glib-2.71.0-10.cm2.aarch64.rpm
202+
glib-2.71.0-11.cm2.aarch64.rpm
203203
libltdl-2.4.6-8.cm2.aarch64.rpm
204204
libltdl-devel-2.4.6-8.cm2.aarch64.rpm
205205
pcre-8.45-2.cm2.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
@@ -199,7 +199,7 @@ libxml2-devel-2.10.4-11.cm2.x86_64.rpm
199199
docbook-dtd-xml-4.5-11.cm2.noarch.rpm
200200
docbook-style-xsl-1.79.1-14.cm2.noarch.rpm
201201
libsepol-3.2-2.cm2.x86_64.rpm
202-
glib-2.71.0-10.cm2.x86_64.rpm
202+
glib-2.71.0-11.cm2.x86_64.rpm
203203
libltdl-2.4.6-8.cm2.x86_64.rpm
204204
libltdl-devel-2.4.6-8.cm2.x86_64.rpm
205205
pcre-8.45-2.cm2.x86_64.rpm

toolkit/resources/manifests/package/toolchain_aarch64.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,11 @@ gdbm-lang-1.21-1.cm2.aarch64.rpm
101101
gettext-0.21-3.cm2.aarch64.rpm
102102
gettext-debuginfo-0.21-3.cm2.aarch64.rpm
103103
gfortran-11.2.0-9.cm2.aarch64.rpm
104-
glib-2.71.0-10.cm2.aarch64.rpm
105-
glib-debuginfo-2.71.0-10.cm2.aarch64.rpm
106-
glib-devel-2.71.0-10.cm2.aarch64.rpm
107-
glib-doc-2.71.0-10.cm2.noarch.rpm
108-
glib-schemas-2.71.0-10.cm2.aarch64.rpm
104+
glib-2.71.0-11.cm2.aarch64.rpm
105+
glib-debuginfo-2.71.0-11.cm2.aarch64.rpm
106+
glib-devel-2.71.0-11.cm2.aarch64.rpm
107+
glib-doc-2.71.0-11.cm2.noarch.rpm
108+
glib-schemas-2.71.0-11.cm2.aarch64.rpm
109109
glibc-2.35-10.cm2.aarch64.rpm
110110
glibc-debuginfo-2.35-10.cm2.aarch64.rpm
111111
glibc-devel-2.35-10.cm2.aarch64.rpm

toolkit/resources/manifests/package/toolchain_x86_64.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,11 @@ gdbm-lang-1.21-1.cm2.x86_64.rpm
106106
gettext-0.21-3.cm2.x86_64.rpm
107107
gettext-debuginfo-0.21-3.cm2.x86_64.rpm
108108
gfortran-11.2.0-9.cm2.x86_64.rpm
109-
glib-2.71.0-10.cm2.x86_64.rpm
110-
glib-debuginfo-2.71.0-10.cm2.x86_64.rpm
111-
glib-devel-2.71.0-10.cm2.x86_64.rpm
112-
glib-doc-2.71.0-10.cm2.noarch.rpm
113-
glib-schemas-2.71.0-10.cm2.x86_64.rpm
109+
glib-2.71.0-11.cm2.x86_64.rpm
110+
glib-debuginfo-2.71.0-11.cm2.x86_64.rpm
111+
glib-devel-2.71.0-11.cm2.x86_64.rpm
112+
glib-doc-2.71.0-11.cm2.noarch.rpm
113+
glib-schemas-2.71.0-11.cm2.x86_64.rpm
114114
glibc-2.35-10.cm2.x86_64.rpm
115115
glibc-debuginfo-2.35-10.cm2.x86_64.rpm
116116
glibc-devel-2.35-10.cm2.x86_64.rpm

0 commit comments

Comments
 (0)