Skip to content

Commit 43d66c1

Browse files
Patch glib for CVE-2025-7039
1 parent be6c44a commit 43d66c1

File tree

6 files changed

+103
-13
lines changed

6 files changed

+103
-13
lines changed

SPECS/glib/CVE-2025-7039.patch

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
From dfc124ea7797cead9b9a21b7d325daf0028a245d Mon Sep 17 00:00:00 2001
2+
From: Alexander Kanavin <[email protected]>
3+
Date: Tue, 22 Aug 2023 19:57:48 +0200
4+
Subject: [PATCH 1/2] glib/gfileutils.c: use 64 bits for value in
5+
get_tmp_file()
6+
7+
On 32 bit systems 'long' value will overflow in 2038 and become negative.
8+
As it is used to index into letters array, and % operation preserves signs,
9+
data corruption will then occur.
10+
11+
Signed-off-by: Alexander Kanavin <[email protected]>
12+
---
13+
glib/gfileutils.c | 4 ++--
14+
1 file changed, 2 insertions(+), 2 deletions(-)
15+
16+
diff --git a/glib/gfileutils.c b/glib/gfileutils.c
17+
index fd5cd3b..645c277 100644
18+
--- a/glib/gfileutils.c
19+
+++ b/glib/gfileutils.c
20+
@@ -1497,7 +1497,7 @@ get_tmp_file (gchar *tmpl,
21+
static const char letters[] =
22+
"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
23+
static const int NLETTERS = sizeof (letters) - 1;
24+
- glong value;
25+
+ gint64 value;
26+
gint64 now_us;
27+
static int counter = 0;
28+
29+
@@ -1518,7 +1518,7 @@ get_tmp_file (gchar *tmpl,
30+
31+
for (count = 0; count < 100; value += 7777, ++count)
32+
{
33+
- glong v = value;
34+
+ gint64 v = value;
35+
36+
/* Fill in the random bits. */
37+
XXXXXX[0] = letters[v % NLETTERS];
38+
--
39+
2.45.4
40+
41+
42+
From 806d8dd3dd9cc96192258723eb356d9ebd1d1876 Mon Sep 17 00:00:00 2001
43+
From: Michael Catanzaro <[email protected]>
44+
Date: Tue, 1 Jul 2025 10:58:07 -0500
45+
Subject: [PATCH 2/2] gfileutils: fix computation of temporary file name
46+
47+
We need to ensure that the value we use to index into the letters array
48+
is always positive.
49+
50+
Fixes #3716
51+
52+
Signed-off-by: Azure Linux Security Servicing Account <[email protected]>
53+
Upstream-reference: https://gitlab.gnome.org/GNOME/glib/-/commit/285db475ecaa4d2cc39ce326b4c63aacb87ca6ad.patch https://gitlab.gnome.org/GNOME/glib/-/commit/61e963284889ddb4544e6f1d5261c16120f6fcc3.patch
54+
---
55+
glib/gfileutils.c | 8 ++++----
56+
1 file changed, 4 insertions(+), 4 deletions(-)
57+
58+
diff --git a/glib/gfileutils.c b/glib/gfileutils.c
59+
index 645c277..a9cf9f7 100644
60+
--- a/glib/gfileutils.c
61+
+++ b/glib/gfileutils.c
62+
@@ -1497,9 +1497,9 @@ get_tmp_file (gchar *tmpl,
63+
static const char letters[] =
64+
"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
65+
static const int NLETTERS = sizeof (letters) - 1;
66+
- gint64 value;
67+
- gint64 now_us;
68+
- static int counter = 0;
69+
+ guint64 value;
70+
+ guint64 now_us;
71+
+ static guint counter = 0;
72+
73+
g_return_val_if_fail (tmpl != NULL, -1);
74+
75+
@@ -1518,7 +1518,7 @@ get_tmp_file (gchar *tmpl,
76+
77+
for (count = 0; count < 100; value += 7777, ++count)
78+
{
79+
- gint64 v = value;
80+
+ guint64 v = value;
81+
82+
/* Fill in the random bits. */
83+
XXXXXX[0] = letters[v % NLETTERS];
84+
--
85+
2.45.4
86+

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: 7%{?dist}
5+
Release: 8%{?dist}
66
License: LGPLv2+
77
Vendor: Microsoft Corporation
88
Distribution: Mariner
@@ -16,6 +16,7 @@ Patch2: CVE-2023-32643-CVE-2023-32636.patch
1616
Patch3: CVE-2025-3360.patch
1717
Patch4: CVE-2025-4373.patch
1818
Patch5: CVE-2024-34397.patch
19+
Patch6: CVE-2025-7039.patch
1920
BuildRequires: cmake
2021
BuildRequires: gtk-doc
2122
BuildRequires: libffi-devel
@@ -129,6 +130,9 @@ touch %{buildroot}%{_libdir}/gio/modules/giomodule.cache
129130
%doc %{_datadir}/gtk-doc/html/*
130131

131132
%changelog
133+
* Mon Sep 08 2025 Azure Linux Security Servicing Account <[email protected]> - 2.71.0-8
134+
- Patch for CVE-2025-7039
135+
132136
* Thu Jul 03 2025 Archana Shettigar <[email protected]> - 2.71.0-7
133137
- Patch CVE-2024-34397
134138

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-8.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-7.cm2.aarch64.rpm
202+
glib-2.71.0-8.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-8.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-7.cm2.x86_64.rpm
202+
glib-2.71.0-8.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-8.cm2.aarch64.rpm
104-
glib-2.71.0-7.cm2.aarch64.rpm
105-
glib-debuginfo-2.71.0-7.cm2.aarch64.rpm
106-
glib-devel-2.71.0-7.cm2.aarch64.rpm
107-
glib-doc-2.71.0-7.cm2.noarch.rpm
108-
glib-schemas-2.71.0-7.cm2.aarch64.rpm
104+
glib-2.71.0-8.cm2.aarch64.rpm
105+
glib-debuginfo-2.71.0-8.cm2.aarch64.rpm
106+
glib-devel-2.71.0-8.cm2.aarch64.rpm
107+
glib-doc-2.71.0-8.cm2.noarch.rpm
108+
glib-schemas-2.71.0-8.cm2.aarch64.rpm
109109
glibc-2.35-7.cm2.aarch64.rpm
110110
glibc-debuginfo-2.35-7.cm2.aarch64.rpm
111111
glibc-devel-2.35-7.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-8.cm2.x86_64.rpm
109-
glib-2.71.0-7.cm2.x86_64.rpm
110-
glib-debuginfo-2.71.0-7.cm2.x86_64.rpm
111-
glib-devel-2.71.0-7.cm2.x86_64.rpm
112-
glib-doc-2.71.0-7.cm2.noarch.rpm
113-
glib-schemas-2.71.0-7.cm2.x86_64.rpm
109+
glib-2.71.0-8.cm2.x86_64.rpm
110+
glib-debuginfo-2.71.0-8.cm2.x86_64.rpm
111+
glib-devel-2.71.0-8.cm2.x86_64.rpm
112+
glib-doc-2.71.0-8.cm2.noarch.rpm
113+
glib-schemas-2.71.0-8.cm2.x86_64.rpm
114114
glibc-2.35-7.cm2.x86_64.rpm
115115
glibc-debuginfo-2.35-7.cm2.x86_64.rpm
116116
glibc-devel-2.35-7.cm2.x86_64.rpm

0 commit comments

Comments
 (0)