Skip to content

Commit ba34121

Browse files
authored
[Medium] Patch glibc for CVE-2025-15281 (#15691)
1 parent 05fb89d commit ba34121

19 files changed

Lines changed: 313 additions & 69 deletions

File tree

SPECS-EXTENDED/buildah/buildah.spec

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
Summary: A command line tool used for creating OCI Images
2222
Name: buildah
2323
Version: 1.18.0
24-
Release: 28%{?dist}
24+
Release: 29%{?dist}
2525
License: ASL 2.0
2626
Vendor: Microsoft Corporation
2727
Distribution: Mariner
@@ -32,7 +32,7 @@ BuildRequires: btrfs-progs-devel
3232
BuildRequires: device-mapper-devel
3333
BuildRequires: git
3434
BuildRequires: glib2-devel
35-
BuildRequires: glibc-static >= 2.35-9%{?dist}
35+
BuildRequires: glibc-static >= 2.35-10%{?dist}
3636
BuildRequires: go-md2man
3737
BuildRequires: go-rpm-macros
3838
BuildRequires: golang
@@ -123,6 +123,9 @@ cp imgtype %{buildroot}/%{_bindir}/%{name}-imgtype
123123
%{_datadir}/%{name}/test
124124

125125
%changelog
126+
* Tue Feb 03 2026 Aditya Singh <v-aditysing@microsoft.com> - 1.18.0-29
127+
- Bump to rebuild with updated glibc
128+
126129
* Wed Jan 28 2026 Kanishk Bansal <kanbansal@microsoft.com> - 1.18.0-28
127130
- Bump to rebuild with updated glibc
128131

SPECS-EXTENDED/catatonit/catatonit.spec

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Distribution: Mariner
33

44
Name: catatonit
55
Version: 0.1.7
6-
Release: 12%{?dist}
6+
Release: 13%{?dist}
77
Summary: A signal-forwarding process manager for containers
88
License: GPLv3+
99
URL: https://github.com/openSUSE/catatonit
@@ -13,7 +13,7 @@ BuildRequires: automake
1313
BuildRequires: file
1414
BuildRequires: gcc
1515
BuildRequires: git
16-
BuildRequires: glibc-static >= 2.35-9%{?dist}
16+
BuildRequires: glibc-static >= 2.35-10%{?dist}
1717
BuildRequires: libtool
1818
BuildRequires: make
1919

@@ -61,6 +61,9 @@ ln -s %{_libexecdir}/%{name}/%{name} %{buildroot}%{_libexecdir}/podman/%{name}
6161
%{_libexecdir}/podman/%{name}
6262

6363
%changelog
64+
* Tue Feb 03 2026 Aditya Singh <v-aditysing@microsoft.com> - 0.1.7-13
65+
- Bump to rebuild with updated glibc
66+
6467
* Wed Jan 28 2026 Kanishk Bansal <kanbansal@microsoft.com> - 0.1.7-12
6568
- Bump to rebuild with updated glibc
6669

SPECS-EXTENDED/dyninst/dyninst.spec

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Summary: An API for Run-time Code Generation
22
License: LGPLv2+
33
Name: dyninst
4-
Release: 14%{?dist}
4+
Release: 15%{?dist}
55
Vendor: Microsoft Corporation
66
Distribution: Mariner
77
URL: http://www.dyninst.org
@@ -31,7 +31,7 @@ BuildRequires: tbb tbb-devel
3131

3232
# Extra requires just for the testsuite
3333
BuildRequires: gcc-gfortran libstdc++-static libxml2-devel
34-
BuildRequires: glibc-static >= 2.35-9%{?dist}
34+
BuildRequires: glibc-static >= 2.35-10%{?dist}
3535

3636
# Testsuite files should not provide/require anything
3737
%{?filter_setup:
@@ -194,6 +194,9 @@ echo "%{_libdir}/dyninst" > %{buildroot}/etc/ld.so.conf.d/%{name}-%{_arch}.conf
194194
%attr(644,root,root) %{_libdir}/dyninst/testsuite/*.a
195195

196196
%changelog
197+
* Tue Feb 03 2026 Aditya Singh <v-aditysing@microsoft.com> - 10.1.0-15
198+
- Bump to rebuild with updated glibc
199+
197200
* Wed Jan 28 2026 Kanishk Bansal <kanbansal@microsoft.com> - 10.1.0-14
198201
- Bump to rebuild with updated glibc
199202

SPECS-EXTENDED/podman/podman.spec

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
Name: podman
3838
Version: 4.1.1
39-
Release: 25%{?dist}
39+
Release: 26%{?dist}
4040
License: ASL 2.0 and BSD and ISC and MIT and MPLv2.0
4141
Summary: Manage Pods, Containers and Container Images
4242
Vendor: Microsoft Corporation
@@ -51,7 +51,7 @@ BuildRequires: go-md2man
5151
BuildRequires: golang
5252
BuildRequires: gcc
5353
BuildRequires: glib2-devel
54-
BuildRequires: glibc-static >= 2.35-9%{?dist}
54+
BuildRequires: glibc-static >= 2.35-10%{?dist}
5555
BuildRequires: git
5656
BuildRequires: go-rpm-macros
5757
BuildRequires: gpgme-devel
@@ -387,6 +387,9 @@ cp -pav test/system %{buildroot}/%{_datadir}/%{name}/test/
387387

388388
# rhcontainerbot account currently managed by lsm5
389389
%changelog
390+
* Tue Feb 03 2026 Aditya Singh <v-aditysing@microsoft.com> - 4.1.1-26
391+
- Bump to rebuild with updated glibc
392+
390393
* Wed Jan 28 2026 Kanishk Bansal <kanbansal@microsoft.com> - 4.1.1-25
391394
- Bump to rebuild with updated glibc
392395

SPECS/busybox/busybox.spec

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Summary: Statically linked binary providing simplified versions of system commands
22
Name: busybox
33
Version: 1.35.0
4-
Release: 16%{?dist}
4+
Release: 17%{?dist}
55
License: GPLv2
66
Vendor: Microsoft Corporation
77
Distribution: Mariner
@@ -25,7 +25,7 @@ Patch11: CVE-2023-42366.patch
2525
Patch12: CVE-2022-48174.patch
2626
Patch13: CVE-2023-39810.patch
2727
BuildRequires: gcc
28-
BuildRequires: glibc-static >= 2.35-9%{?dist}
28+
BuildRequires: glibc-static >= 2.35-10%{?dist}
2929
BuildRequires: libselinux-devel >= 1.27.7-2
3030
BuildRequires: libsepol-devel
3131
# libbb/hash_md5_sha.c
@@ -103,6 +103,9 @@ install -m 644 docs/busybox.petitboot.1 %{buildroot}/%{_mandir}/man1/busybox.pet
103103
%{_mandir}/man1/busybox.petitboot.1.gz
104104

105105
%changelog
106+
* Tue Feb 03 2026 Aditya Singh <v-aditysing@microsoft.com> - 1.35.0-17
107+
- Bump to rebuild with updated glibc
108+
106109
* Wed Jan 28 2026 Kanishk Bansal <kanbansal@microsoft.com> - 1.35.0-16
107110
- Bump to rebuild with updated glibc
108111

SPECS/flannel/flannel.spec

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Summary: Simple and easy way to configure a layer 3 network fabric designed for Kubernetes
55
Name: flannel
66
Version: 0.14.0
7-
Release: 29%{?dist}
7+
Release: 30%{?dist}
88
License: ASL 2.0
99
Vendor: Microsoft Corporation
1010
Distribution: Mariner
@@ -17,7 +17,7 @@ Patch1: CVE-2025-65637.patch
1717

1818
BuildRequires: gcc
1919
BuildRequires: glibc-devel
20-
BuildRequires: glibc-static >= 2.35-9%{?dist}
20+
BuildRequires: glibc-static >= 2.35-10%{?dist}
2121
BuildRequires: golang
2222
BuildRequires: kernel-headers
2323

@@ -50,6 +50,9 @@ install -p -m 755 -t %{buildroot}%{_bindir} ./dist/flanneld
5050
%{_bindir}/flanneld
5151

5252
%changelog
53+
* Tue Feb 03 2026 Aditya Singh <v-aditysing@microsoft.com> - 0.14.0-30
54+
- Bump to rebuild with updated glibc
55+
5356
* Wed Jan 28 2026 Kanishk Bansal <kanbansal@microsoft.com> - 0.14.0-29
5457
- Bump to rebuild with updated glibc
5558

SPECS/glibc/CVE-2025-15281.patch

Lines changed: 201 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,201 @@
1+
From ce65d944e38a20cb70af2a48a4b8aa5d8fabe1cc Mon Sep 17 00:00:00 2001
2+
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
3+
Date: Thu, 15 Jan 2026 10:32:19 -0300
4+
Subject: [PATCH 1/1] posix: Reset wordexp_t fields with WRDE_REUSE
5+
(CVE-2025-15281 / BZ 33814)
6+
7+
The wordexp fails to properly initialize the input wordexp_t when
8+
WRDE_REUSE is used. The wordexp_t struct is properly freed, but
9+
reuses the old wc_wordc value and updates the we_wordv in the
10+
wrong position. A later wordfree will then call free with an
11+
invalid pointer.
12+
13+
Checked on x86_64-linux-gnu and i686-linux-gnu.
14+
15+
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
16+
(cherry picked from commit 80cc58ea2de214f85b0a1d902a3b668ad2ecb302)
17+
18+
Upstream Patch Reference: https://sourceware.org/git/?p=glibc.git;a=patch;h=ce65d944e38a20cb70af2a48a4b8aa5d8fabe1cc;hp=831f63b94ceb92fb14c0d1a7ddad35a0d1404c71
19+
---
20+
NEWS | 6 +++
21+
posix/Makefile | 10 +++++
22+
posix/tst-wordexp-reuse.c | 89 +++++++++++++++++++++++++++++++++++++++
23+
posix/wordexp.c | 2 +
24+
4 files changed, 107 insertions(+)
25+
create mode 100644 posix/tst-wordexp-reuse.c
26+
27+
diff --git a/NEWS b/NEWS
28+
index faa7ec18..d8fbec32 100644
29+
--- a/NEWS
30+
+++ b/NEWS
31+
@@ -199,6 +199,10 @@ Security related changes:
32+
corresponds to the / directory through an unprivileged mount
33+
namespace. Reported by Qualys.
34+
35+
+ GLIBC-SA-2026-0003
36+
+ wordexp with WRDE_REUSE and WRDE_APPEND may return uninitialized
37+
+ memory (CVE-2025-15281)
38+
+
39+
The following bugs are resolved with this release:
40+
41+
[12889] nptl: Race condition in pthread_kill
42+
@@ -335,6 +339,8 @@ The following bugs are resolved with this release:
43+
[28837] libc: FAIL: socket/tst-socket-timestamp-compat
44+
[28847] locale: Empty mon_decimal_point in LC_MONETARY results in non-
45+
empty mon_decimal_point_wc
46+
+ [33814] glob: wordexp with WRDE_REUSE and WRDE_APPEND may return
47+
+ uninitialized memory
48+
49+
50+
Version 2.34
51+
diff --git a/posix/Makefile b/posix/Makefile
52+
index 9b30b53a..bc068ed9 100644
53+
--- a/posix/Makefile
54+
+++ b/posix/Makefile
55+
@@ -109,6 +109,7 @@ tests := test-errno tstgetopt testfnm runtests runptests \
56+
tst-glob-tilde test-ssize-max tst-spawn4 bug-regex37 \
57+
bug-regex38 tst-regcomp-truncated tst-spawn-chdir \
58+
tst-wordexp-nocmd tst-execveat tst-spawn5 \
59+
+ tst-wordexp-reuse \
60+
tst-sched_getaffinity tst-spawn6
61+
62+
# Test for the glob symbol version that was replaced in glibc 2.27.
63+
@@ -156,6 +157,7 @@ generated += $(addprefix wordexp-test-result, 1 2 3 4 5 6 7 8 9 10) \
64+
bug-glob2.mtrace bug-glob2-mem.out tst-vfork3-mem.out \
65+
tst-vfork3.mtrace getconf.speclist tst-fnmatch-mem.out \
66+
tst-fnmatch.mtrace bug-regex36.mtrace \
67+
+ tst-wordexp-reuse-mem.out tst-wordexp-reuse.mtrace \
68+
testcases.h ptestcases.h
69+
70+
ifeq ($(run-built-tests),yes)
71+
@@ -174,6 +176,7 @@ tests-special += $(objpfx)bug-regex2-mem.out $(objpfx)bug-regex14-mem.out \
72+
$(objpfx)tst-boost-mem.out $(objpfx)tst-getconf.out \
73+
$(objpfx)bug-glob2-mem.out $(objpfx)tst-vfork3-mem.out \
74+
$(objpfx)tst-fnmatch-mem.out $(objpfx)bug-regex36-mem.out \
75+
+ $(objpfx)tst-wordexp-reuse.out \
76+
$(objpfx)tst-glob-tilde-mem.out $(objpfx)bug-ga2-mem.out
77+
endif
78+
79+
@@ -451,3 +454,10 @@ $(objpfx)posix-conf-vars-def.h: $(..)scripts/gen-posix-conf-vars.awk \
80+
$(make-target-directory)
81+
$(AWK) -f $(filter-out Makefile, $^) > $@.tmp
82+
mv -f $@.tmp $@
83+
+
84+
+tst-wordexp-reuse-ENV += MALLOC_TRACE=$(objpfx)tst-wordexp-reuse.mtrace \
85+
+ LD_PRELOAD=$(common-objpfx)/malloc/libc_malloc_debug.so
86+
+
87+
+$(objpfx)tst-wordexp-reuse-mem.out: $(objpfx)tst-wordexp-reuse.out \
88+
+ $(common-objpfx)malloc/mtrace $(objpfx)tst-wordexp-reuse.mtrace > $@; \
89+
+ $(evaluate-test)
90+
diff --git a/posix/tst-wordexp-reuse.c b/posix/tst-wordexp-reuse.c
91+
new file mode 100644
92+
index 00000000..c2c12fd1
93+
--- /dev/null
94+
+++ b/posix/tst-wordexp-reuse.c
95+
@@ -0,0 +1,89 @@
96+
+/* Test for wordexp with WRDE_REUSE flag.
97+
+ Copyright (C) 2026 Free Software Foundation, Inc.
98+
+ This file is part of the GNU C Library.
99+
+
100+
+ The GNU C Library is free software; you can redistribute it and/or
101+
+ modify it under the terms of the GNU Lesser General Public
102+
+ License as published by the Free Software Foundation; either
103+
+ version 2.1 of the License, or (at your option) any later version.
104+
+
105+
+ The GNU C Library is distributed in the hope that it will be useful,
106+
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
107+
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
108+
+ Lesser General Public License for more details.
109+
+
110+
+ You should have received a copy of the GNU Lesser General Public
111+
+ License along with the GNU C Library; if not, see
112+
+ <https://www.gnu.org/licenses/>. */
113+
+
114+
+#include <wordexp.h>
115+
+#include <mcheck.h>
116+
+
117+
+#include <support/check.h>
118+
+
119+
+static int
120+
+do_test (void)
121+
+{
122+
+ mtrace ();
123+
+
124+
+ {
125+
+ wordexp_t p = { 0 };
126+
+ TEST_COMPARE (wordexp ("one", &p, 0), 0);
127+
+ TEST_COMPARE (p.we_wordc, 1);
128+
+ TEST_COMPARE_STRING (p.we_wordv[0], "one");
129+
+ TEST_COMPARE (wordexp ("two", &p, WRDE_REUSE), 0);
130+
+ TEST_COMPARE (p.we_wordc, 1);
131+
+ TEST_COMPARE_STRING (p.we_wordv[0], "two");
132+
+ wordfree (&p);
133+
+ }
134+
+
135+
+ {
136+
+ wordexp_t p = { .we_offs = 2 };
137+
+ TEST_COMPARE (wordexp ("one", &p, 0), 0);
138+
+ TEST_COMPARE (p.we_wordc, 1);
139+
+ TEST_COMPARE_STRING (p.we_wordv[0], "one");
140+
+ TEST_COMPARE (wordexp ("two", &p, WRDE_REUSE | WRDE_DOOFFS), 0);
141+
+ TEST_COMPARE (p.we_wordc, 1);
142+
+ TEST_COMPARE_STRING (p.we_wordv[p.we_offs + 0], "two");
143+
+ wordfree (&p);
144+
+ }
145+
+
146+
+ {
147+
+ wordexp_t p = { 0 };
148+
+ TEST_COMPARE (wordexp ("one", &p, 0), 0);
149+
+ TEST_COMPARE (p.we_wordc, 1);
150+
+ TEST_COMPARE_STRING (p.we_wordv[0], "one");
151+
+ TEST_COMPARE (wordexp ("two", &p, WRDE_REUSE | WRDE_APPEND), 0);
152+
+ TEST_COMPARE (p.we_wordc, 1);
153+
+ TEST_COMPARE_STRING (p.we_wordv[0], "two");
154+
+ wordfree (&p);
155+
+ }
156+
+
157+
+ {
158+
+ wordexp_t p = { .we_offs = 2 };
159+
+ TEST_COMPARE (wordexp ("one", &p, WRDE_DOOFFS), 0);
160+
+ TEST_COMPARE (p.we_wordc, 1);
161+
+ TEST_COMPARE_STRING (p.we_wordv[p.we_offs + 0], "one");
162+
+ TEST_COMPARE (wordexp ("two", &p, WRDE_REUSE
163+
+ | WRDE_DOOFFS), 0);
164+
+ TEST_COMPARE (p.we_wordc, 1);
165+
+ TEST_COMPARE_STRING (p.we_wordv[p.we_offs + 0], "two");
166+
+ wordfree (&p);
167+
+ }
168+
+
169+
+ {
170+
+ wordexp_t p = { .we_offs = 2 };
171+
+ TEST_COMPARE (wordexp ("one", &p, WRDE_DOOFFS), 0);
172+
+ TEST_COMPARE (p.we_wordc, 1);
173+
+ TEST_COMPARE_STRING (p.we_wordv[p.we_offs + 0], "one");
174+
+ TEST_COMPARE (wordexp ("two", &p, WRDE_REUSE
175+
+ | WRDE_DOOFFS | WRDE_APPEND), 0);
176+
+ TEST_COMPARE (p.we_wordc, 1);
177+
+ TEST_COMPARE_STRING (p.we_wordv[p.we_offs + 0], "two");
178+
+ wordfree (&p);
179+
+ }
180+
+
181+
+ return 0;
182+
+}
183+
+
184+
+#include <support/test-driver.c>
185+
diff --git a/posix/wordexp.c b/posix/wordexp.c
186+
index d4cb9c73..25f5b509 100644
187+
--- a/posix/wordexp.c
188+
+++ b/posix/wordexp.c
189+
@@ -2219,7 +2219,9 @@ wordexp (const char *words, wordexp_t *pwordexp, int flags)
190+
{
191+
/* Minimal implementation of WRDE_REUSE for now */
192+
wordfree (pwordexp);
193+
+ old_word.we_wordc = 0;
194+
old_word.we_wordv = NULL;
195+
+ pwordexp->we_wordc = 0;
196+
}
197+
198+
if ((flags & WRDE_APPEND) == 0)
199+
--
200+
2.45.4
201+

SPECS/glibc/glibc.spec

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
Summary: Main C library
88
Name: glibc
99
Version: 2.35
10-
Release: 9%{?dist}
10+
Release: 10%{?dist}
1111
License: BSD AND GPLv2+ AND Inner-Net AND ISC AND LGPLv2+ AND MIT
1212
Vendor: Microsoft Corporation
1313
Distribution: Mariner
@@ -38,6 +38,7 @@ Patch12: CVE-2024-33601.patch
3838
Patch13: CVE-2026-0861.patch
3939
Patch14: CVE-2026-0915.patch
4040
Patch15: CVE-2025-0395.patch
41+
Patch16: CVE-2025-15281.patch
4142
BuildRequires: bison
4243
BuildRequires: gawk
4344
BuildRequires: gettext
@@ -330,6 +331,9 @@ grep "^FAIL: nptl/tst-eintr1" tests.sum >/dev/null && n=$((n+1)) ||:
330331
%defattr(-,root,root)
331332

332333
%changelog
334+
* Tue Feb 03 2026 Aditya Singh <v-aditysing@microsoft.com> - 2.35-10
335+
- Patch for CVE-2025-15281
336+
333337
* Wed Jan 28 2026 Azure Linux Security Servicing Account <azurelinux-security@microsoft.com> - 2.35-9
334338
- Patch for CVE-2025-0395
335339

0 commit comments

Comments
 (0)