Skip to content

Commit c326e08

Browse files
azurelinux-securityKanishk Bansal
andauthored
[AutoPR- Security] Patch glibc for CVE-2025-15281 [MEDIUM] (#15561)
Co-authored-by: Kanishk Bansal <kanbansal@microsoft.com>
1 parent 7ebb2ef commit c326e08

22 files changed

Lines changed: 308 additions & 79 deletions

File tree

SPECS-EXTENDED/buildah/buildah.spec

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Epoch: 0
3030
Version: 1.41.4
3131
# The `AND` needs to be uppercase in the License for SPDX compatibility
3232
License: Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0
33-
Release: 5%{?dist}
33+
Release: 6%{?dist}
3434
Vendor: Microsoft Corporation
3535
Distribution: Azure Linux
3636
ExclusiveArch: aarch64 ppc64le s390x x86_64
@@ -43,7 +43,7 @@ BuildRequires: device-mapper-devel
4343
BuildRequires: git-core
4444
BuildRequires: golang >= 1.16.6
4545
BuildRequires: glib2-devel
46-
BuildRequires: glibc-static >= 2.38-17%{?dist}
46+
BuildRequires: glibc-static >= 2.38-18%{?dist}
4747
%if !%{defined gobuild}
4848
BuildRequires: go-rpm-macros
4949
%endif
@@ -173,6 +173,9 @@ make test-unit
173173
%{_datadir}/%{name}/test
174174

175175
%changelog
176+
* Thu Jan 22 2026 Kanishk Bansal <kanbansal@microsoft.com> - 0:1.41.4-6
177+
- Bump to rebuild with updated glibc
178+
176179
* Mon Jan 19 2026 Kanishk Bansal <kanbansal@microsoft.com> - 0:1.41.4-5
177180
- Bump to rebuild with updated glibc
178181

SPECS-EXTENDED/catatonit/catatonit.spec

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

44
Name: catatonit
55
Version: 0.1.7
6-
Release: 25%{?dist}
6+
Release: 26%{?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.38-17%{?dist}
16+
BuildRequires: glibc-static >= 2.38-18%{?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+
* Thu Jan 22 2026 Kanishk Bansal <kanbansal@microsoft.com> - 0.1.7-26
65+
- Bump to rebuild with updated glibc
66+
6467
* Mon Jan 19 2026 Kanishk Bansal <kanbansal@microsoft.com> - 0.1.7-25
6568
- Bump to rebuild with updated glibc
6669

SPECS-EXTENDED/crun/crun.spec

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
Summary: OCI runtime written in C
1313
Name: crun
1414
Version: 1.24
15-
Release: 2%{?dist}
15+
Release: 3%{?dist}
1616
Vendor: Microsoft Corporation
1717
Distribution: Azure Linux
1818
URL: https://github.com/containers/%{name}
@@ -48,7 +48,7 @@ BuildRequires: wasmedge-devel
4848
%endif
4949

5050
BuildRequires: python
51-
BuildRequires: glibc-static >= 2.38-17%{?dist}
51+
BuildRequires: glibc-static >= 2.38-18%{?dist}
5252
Provides: oci-runtime
5353

5454
%description
@@ -114,6 +114,9 @@ rm -rf %{buildroot}%{_prefix}/lib*
114114
%endif
115115

116116
%changelog
117+
* Thu Jan 22 2026 Kanishk Bansal <kanbansal@microsoft.com> - 1.24-3
118+
- Bump to rebuild with updated glibc
119+
117120
* Mon Jan 19 2026 Kanishk Bansal <kanbansal@microsoft.com> - 1.24-2
118121
- Bump to rebuild with updated glibc
119122

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: 27%{?dist}
4+
Release: 28%{?dist}
55
Vendor: Microsoft Corporation
66
Distribution: Azure Linux
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.38-17%{?dist}
34+
BuildRequires: glibc-static >= 2.38-18%{?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+
* Thu Jan 22 2026 Kanishk Bansal <kanbansal@microsoft.com> - 10.1.0-28
198+
- Bump to rebuild with updated glibc
199+
197200
* Mon Jan 19 2026 Kanishk Bansal <kanbansal@microsoft.com> - 10.1.0-27
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
@@ -31,7 +31,7 @@ Epoch: 0
3131
# If you're reading this on dist-git, the version is automatically filled in by Packit.
3232
Version: 5.6.1
3333
License: Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0
34-
Release: 6%{?dist}
34+
Release: 7%{?dist}
3535
ExclusiveArch: aarch64 ppc64le s390x x86_64 riscv64
3636
Summary: Manage Pods, Containers and Container Images
3737
Vendor: Microsoft Corporation
@@ -48,7 +48,7 @@ BuildRequires: btrfs-progs-devel
4848
BuildRequires: gcc
4949
BuildRequires: glib2-devel
5050
BuildRequires: glibc-devel
51-
BuildRequires: glibc-static >= 2.38-17%{?dist}
51+
BuildRequires: glibc-static >= 2.38-18%{?dist}
5252
BuildRequires: golang
5353
BuildRequires: git-core
5454

@@ -298,6 +298,9 @@ make localunit
298298

299299
# rhcontainerbot account currently managed by lsm5
300300
%changelog
301+
* Thu Jan 22 2026 Kanishk Bansal <kanbansal@microsoft.com> - 0:5.6.1-7
302+
- Bump to rebuild with updated glibc
303+
301304
* Mon Jan 19 2026 Kanishk Bansal <kanbansal@microsoft.com> - 0:5.6.1-6
302305
- Bump to rebuild with updated glibc
303306

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.36.1
4-
Release: 20%{?dist}
4+
Release: 21%{?dist}
55
License: GPLv2
66
Vendor: Microsoft Corporation
77
Distribution: Azure Linux
@@ -19,7 +19,7 @@ Patch5: CVE-2023-42366.patch
1919
Patch6: CVE-2023-39810.patch
2020
Patch7: CVE-2022-48174.patch
2121
BuildRequires: gcc
22-
BuildRequires: glibc-static >= 2.38-17%{?dist}
22+
BuildRequires: glibc-static >= 2.38-18%{?dist}
2323
BuildRequires: libselinux-devel >= 1.27.7-2
2424
BuildRequires: libsepol-devel
2525
%if 0%{?with_check}
@@ -106,6 +106,9 @@ SKIP_KNOWN_BUGS=1 ./runtest
106106
%{_mandir}/man1/busybox.petitboot.1.gz
107107

108108
%changelog
109+
* Thu Jan 22 2026 Kanishk Bansal <kanbansal@microsoft.com> - 1.36.1-21
110+
- Bump to rebuild with updated glibc
111+
109112
* Mon Jan 19 2026 Kanishk Bansal <kanbansal@microsoft.com> - 1.36.1-20
110113
- Bump to rebuild with updated glibc
111114

SPECS/flannel/flannel.spec

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Summary: Simple and easy way to configure a layer 3 network fabric designed for Kubernetes
44
Name: flannel
55
Version: 0.24.2
6-
Release: 23%{?dist}
6+
Release: 24%{?dist}
77
License: ASL 2.0
88
Vendor: Microsoft Corporation
99
Distribution: Azure Linux
@@ -19,7 +19,7 @@ Patch4: CVE-2024-51744.patch
1919
Patch5: CVE-2025-65637.patch
2020
BuildRequires: gcc
2121
BuildRequires: glibc-devel
22-
BuildRequires: glibc-static >= 2.38-17%{?dist}
22+
BuildRequires: glibc-static >= 2.38-18%{?dist}
2323
BuildRequires: golang < 1.25
2424
BuildRequires: kernel-headers
2525

@@ -53,6 +53,9 @@ install -p -m 755 -t %{buildroot}%{_bindir} ./dist/flanneld
5353
%{_bindir}/flanneld
5454

5555
%changelog
56+
* Thu Jan 22 2026 Kanishk Bansal <kanbansal@microsoft.com> - 0.24.2-24
57+
- Bump to rebuild with updated glibc
58+
5659
* Mon Jan 19 2026 Kanishk Bansal <kanbansal@microsoft.com> - 0.24.2-23
5760
- Bump to rebuild with updated glibc
5861

SPECS/glibc/CVE-2025-15281.patch

Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
From bf108a5fe1a992e5a6057fefa5d3d54f06300d3b 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] posix: Reset wordexp_t fields with WRDE_REUSE (CVE-2025-15281
5+
/ 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+
Signed-off-by: Azure Linux Security Servicing Account <azurelinux-security@microsoft.com>
18+
Upstream-reference: https://github.com/bminor/glibc/commit/d5409a1be010699794264162c551ba60f05ee6c3.patch
19+
---
20+
posix/Makefile | 11 +++++
21+
posix/tst-wordexp-reuse.c | 89 +++++++++++++++++++++++++++++++++++++++
22+
posix/wordexp.c | 2 +
23+
3 files changed, 102 insertions(+)
24+
create mode 100644 posix/tst-wordexp-reuse.c
25+
26+
diff --git a/posix/Makefile b/posix/Makefile
27+
index 1fc0f565..7db396fb 100644
28+
--- a/posix/Makefile
29+
+++ b/posix/Makefile
30+
@@ -328,6 +328,7 @@ tests := \
31+
tst-wait4 \
32+
tst-waitid \
33+
tst-wordexp-nocmd \
34+
+ tst-wordexp-reuse \
35+
tstgetopt \
36+
# tests
37+
38+
@@ -453,6 +454,8 @@ generated += \
39+
tst-rxspencer-no-utf8.mtrace \
40+
tst-vfork3-mem.out \
41+
tst-vfork3.mtrace \
42+
+ tst-wordexp-reuse-mem.out \
43+
+ tst-wordexp-reuse.mtrace \
44+
wordexp-tst.out \
45+
# generated
46+
47+
@@ -484,6 +487,7 @@ tests-special += \
48+
$(objpfx)tst-pcre-mem.out \
49+
$(objpfx)tst-rxspencer-no-utf8-mem.out \
50+
$(objpfx)tst-vfork3-mem.out \
51+
+ $(objpfx)tst-wordexp-reuse.out \
52+
# tests-special
53+
endif
54+
55+
@@ -765,3 +769,10 @@ $(objpfx)posix-conf-vars-def.h: $(..)scripts/gen-posix-conf-vars.awk \
56+
$(make-target-directory)
57+
$(AWK) -f $(filter-out Makefile, $^) > $@.tmp
58+
mv -f $@.tmp $@
59+
+
60+
+tst-wordexp-reuse-ENV += MALLOC_TRACE=$(objpfx)tst-wordexp-reuse.mtrace \
61+
+ LD_PRELOAD=$(common-objpfx)/malloc/libc_malloc_debug.so
62+
+
63+
+$(objpfx)tst-wordexp-reuse-mem.out: $(objpfx)tst-wordexp-reuse.out
64+
+ $(common-objpfx)malloc/mtrace $(objpfx)tst-wordexp-reuse.mtrace > $@; \
65+
+ $(evaluate-test)
66+
diff --git a/posix/tst-wordexp-reuse.c b/posix/tst-wordexp-reuse.c
67+
new file mode 100644
68+
index 00000000..3926b9f5
69+
--- /dev/null
70+
+++ b/posix/tst-wordexp-reuse.c
71+
@@ -0,0 +1,89 @@
72+
+/* Test for wordexp with WRDE_REUSE flag.
73+
+ Copyright (C) 2026 Free Software Foundation, Inc.
74+
+ This file is part of the GNU C Library.
75+
+
76+
+ The GNU C Library is free software; you can redistribute it and/or
77+
+ modify it under the terms of the GNU Lesser General Public
78+
+ License as published by the Free Software Foundation; either
79+
+ version 2.1 of the License, or (at your option) any later version.
80+
+
81+
+ The GNU C Library is distributed in the hope that it will be useful,
82+
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
83+
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
84+
+ Lesser General Public License for more details.
85+
+
86+
+ You should have received a copy of the GNU Lesser General Public
87+
+ License along with the GNU C Library; if not, see
88+
+ <https://www.gnu.org/licenses/>. */
89+
+
90+
+#include <wordexp.h>
91+
+#include <mcheck.h>
92+
+
93+
+#include <support/check.h>
94+
+
95+
+static int
96+
+do_test (void)
97+
+{
98+
+ mtrace ();
99+
+
100+
+ {
101+
+ wordexp_t p = { 0 };
102+
+ TEST_COMPARE (wordexp ("one", &p, 0), 0);
103+
+ TEST_COMPARE (p.we_wordc, 1);
104+
+ TEST_COMPARE_STRING (p.we_wordv[0], "one");
105+
+ TEST_COMPARE (wordexp ("two", &p, WRDE_REUSE), 0);
106+
+ TEST_COMPARE (p.we_wordc, 1);
107+
+ TEST_COMPARE_STRING (p.we_wordv[0], "two");
108+
+ wordfree (&p);
109+
+ }
110+
+
111+
+ {
112+
+ wordexp_t p = { .we_offs = 2 };
113+
+ TEST_COMPARE (wordexp ("one", &p, 0), 0);
114+
+ TEST_COMPARE (p.we_wordc, 1);
115+
+ TEST_COMPARE_STRING (p.we_wordv[0], "one");
116+
+ TEST_COMPARE (wordexp ("two", &p, WRDE_REUSE | WRDE_DOOFFS), 0);
117+
+ TEST_COMPARE (p.we_wordc, 1);
118+
+ TEST_COMPARE_STRING (p.we_wordv[p.we_offs + 0], "two");
119+
+ wordfree (&p);
120+
+ }
121+
+
122+
+ {
123+
+ wordexp_t p = { 0 };
124+
+ TEST_COMPARE (wordexp ("one", &p, 0), 0);
125+
+ TEST_COMPARE (p.we_wordc, 1);
126+
+ TEST_COMPARE_STRING (p.we_wordv[0], "one");
127+
+ TEST_COMPARE (wordexp ("two", &p, WRDE_REUSE | WRDE_APPEND), 0);
128+
+ TEST_COMPARE (p.we_wordc, 1);
129+
+ TEST_COMPARE_STRING (p.we_wordv[0], "two");
130+
+ wordfree (&p);
131+
+ }
132+
+
133+
+ {
134+
+ wordexp_t p = { .we_offs = 2 };
135+
+ TEST_COMPARE (wordexp ("one", &p, WRDE_DOOFFS), 0);
136+
+ TEST_COMPARE (p.we_wordc, 1);
137+
+ TEST_COMPARE_STRING (p.we_wordv[p.we_offs + 0], "one");
138+
+ TEST_COMPARE (wordexp ("two", &p, WRDE_REUSE
139+
+ | WRDE_DOOFFS), 0);
140+
+ TEST_COMPARE (p.we_wordc, 1);
141+
+ TEST_COMPARE_STRING (p.we_wordv[p.we_offs + 0], "two");
142+
+ wordfree (&p);
143+
+ }
144+
+
145+
+ {
146+
+ wordexp_t p = { .we_offs = 2 };
147+
+ TEST_COMPARE (wordexp ("one", &p, WRDE_DOOFFS), 0);
148+
+ TEST_COMPARE (p.we_wordc, 1);
149+
+ TEST_COMPARE_STRING (p.we_wordv[p.we_offs + 0], "one");
150+
+ TEST_COMPARE (wordexp ("two", &p, WRDE_REUSE
151+
+ | WRDE_DOOFFS | WRDE_APPEND), 0);
152+
+ TEST_COMPARE (p.we_wordc, 1);
153+
+ TEST_COMPARE_STRING (p.we_wordv[p.we_offs + 0], "two");
154+
+ wordfree (&p);
155+
+ }
156+
+
157+
+ return 0;
158+
+}
159+
+
160+
+#include <support/test-driver.c>
161+
diff --git a/posix/wordexp.c b/posix/wordexp.c
162+
index 994d7916..5c5863b5 100644
163+
--- a/posix/wordexp.c
164+
+++ b/posix/wordexp.c
165+
@@ -2216,7 +2216,9 @@ wordexp (const char *words, wordexp_t *pwordexp, int flags)
166+
{
167+
/* Minimal implementation of WRDE_REUSE for now */
168+
wordfree (pwordexp);
169+
+ old_word.we_wordc = 0;
170+
old_word.we_wordv = NULL;
171+
+ pwordexp->we_wordc = 0;
172+
}
173+
174+
if ((flags & WRDE_APPEND) == 0)
175+
--
176+
2.45.4
177+

0 commit comments

Comments
 (0)