Skip to content

Commit 88cd4cb

Browse files
committed
Merge pull request #75928 from xnox/fix-glibc-cves
fix(glibc): cherry-pick patches from mailing list for CVE fixes Export: 433c2cea96cf9455ba63d34361b4822167e29112
1 parent bcb6f44 commit 88cd4cb

16 files changed

Lines changed: 270 additions & 34 deletions

bun.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
package:
22
name: bun
33
version: "1.3.13"
4-
epoch: 0 # go/wolfi-rsc/bun
4+
epoch: 1 # go/wolfi-rsc/bun
55
description: "Incredibly fast JavaScript runtime, bundler, test runner, and package manager - all in one"
66
copyright:
77
- license: MIT
88
resources:
99
cpu: "42"
1010
memory: 38Gi
11+
test-resources:
12+
cpu: "1"
13+
memory: 1Gi
1114

1215
environment:
1316
contents:

glibc.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package:
33
name: glibc
44
version: "2.43"
55
# Every glibc update causes build disruption; always announce on #eng-psa
6-
epoch: 6
6+
epoch: 7
77
description: "the GNU C library"
88
copyright:
99
- license: LGPL-2.1-or-later
@@ -73,7 +73,10 @@ pipeline:
7373

7474
- uses: patch
7575
with:
76-
patches: 0001-Link-startup-files-without-package-metadata.patch
76+
patches: |
77+
0001-Link-startup-files-without-package-metadata.patch
78+
0002-libio-Fix-ungetwc-operating-on-byte-stream-BZ-33998.patch
79+
0003-stdio-common-Fix-buffer-overflow-in-scanf-mc-BZ-3400.patch
7780
7881
- name: "Set up build directory"
7982
runs: |
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
From e85c81525672df5003ff113ca1189dbed88c673f Mon Sep 17 00:00:00 2001
2+
From: Rocket Ma <marocketbd@gmail.com>
3+
Date: Sat, 18 Apr 2026 03:17:42 -0700
4+
Subject: [PATCH 2/3] libio: Fix ungetwc operating on byte stream [BZ #33998]
5+
6+
* libio/wgenops.c: When _IO_wdefault_pbackfail attempts to push back one
7+
character, it accidently compare the wchar to push back with the last
8+
char from byte stream, instead of wide stream. Under specific coding,
9+
attacker may exploit this to leak information. This commit fix bug
10+
33998, or CVE-2026-5928.
11+
12+
Signed-off-by: Rocket Ma <marocketbd@gmail.com>
13+
Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@surgut.co.uk>
14+
---
15+
libio/Makefile | 1 +
16+
libio/bug-wgenops-bz33998.c | 44 +++++++++++++++++++++++++++++++++++++
17+
libio/wgenops.c | 4 ++--
18+
3 files changed, 47 insertions(+), 2 deletions(-)
19+
create mode 100644 libio/bug-wgenops-bz33998.c
20+
21+
diff --git a/libio/Makefile b/libio/Makefile
22+
index 4f4dd9f275..5995adf5dd 100644
23+
--- a/libio/Makefile
24+
+++ b/libio/Makefile
25+
@@ -84,6 +84,7 @@ tests = \
26+
bug-ungetwc1 \
27+
bug-ungetwc2 \
28+
bug-wfflush \
29+
+ bug-wgenops-bz33998 \
30+
bug-wmemstream1 \
31+
bug-wsetpos \
32+
test-fmemopen \
33+
diff --git a/libio/bug-wgenops-bz33998.c b/libio/bug-wgenops-bz33998.c
34+
new file mode 100644
35+
index 0000000000..b3f750a753
36+
--- /dev/null
37+
+++ b/libio/bug-wgenops-bz33998.c
38+
@@ -0,0 +1,44 @@
39+
+/* Regression test for ungetwc operating on byte stream (BZ #33998)
40+
+ Copyright (C) 2026 The GNU Toolchain Authors.
41+
+ This file is part of the GNU C Library.
42+
+
43+
+ The GNU C Library is free software; you can redistribute it and/or
44+
+ modify it under the terms of the GNU Lesser General Public
45+
+ License as published by the Free Software Foundation; either
46+
+ version 2.1 of the License, or (at your option) any later version.
47+
+
48+
+ The GNU C Library is distributed in the hope that it will be useful,
49+
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
50+
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
51+
+ Lesser General Public License for more details.
52+
+
53+
+ You should have received a copy of the GNU Lesser General Public
54+
+ License along with the GNU C Library; if not, see
55+
+ <https://www.gnu.org/licenses/>. */
56+
+
57+
+#include <unistd.h>
58+
+#include <sys/mman.h>
59+
+#include <stdio.h>
60+
+#include <wchar.h>
61+
+#include <support/check.h>
62+
+
63+
+static int
64+
+do_test (void)
65+
+{
66+
+ int fd = memfd_create ("test", MFD_CLOEXEC);
67+
+ TEST_VERIFY (fd != -1);
68+
+ TEST_COMPARE (write (fd, (unsigned char[]){ 'A', 0, 0, 0 }, 4), 4);
69+
+ TEST_COMPARE (lseek (fd, 0, SEEK_SET), 0);
70+
+ FILE *fp = fdopen (fd, "r+");
71+
+ TEST_VERIFY (fp != NULL);
72+
+ TEST_COMPARE (getwc (fp), L'A');
73+
+
74+
+ /* if the bug is fixed, then ungetwc should not touch byte stream. */
75+
+ char *old_read_ptr = fp->_IO_read_ptr;
76+
+ TEST_COMPARE (ungetwc (0, fp), L'\0');
77+
+ TEST_VERIFY (fp->_IO_read_ptr == old_read_ptr);
78+
+
79+
+ return 0;
80+
+}
81+
+
82+
+#include <support/test-driver.c>
83+
diff --git a/libio/wgenops.c b/libio/wgenops.c
84+
index 7a8466ea44..7c47459828 100644
85+
--- a/libio/wgenops.c
86+
+++ b/libio/wgenops.c
87+
@@ -108,8 +108,8 @@ _IO_wdefault_pbackfail (FILE *fp, wint_t c)
88+
{
89+
if (fp->_wide_data->_IO_read_ptr > fp->_wide_data->_IO_read_base
90+
&& !_IO_in_backup (fp)
91+
- && (wint_t) fp->_IO_read_ptr[-1] == c)
92+
- --fp->_IO_read_ptr;
93+
+ && (wint_t) fp->_wide_data->_IO_read_ptr[-1] == c)
94+
+ --fp->_wide_data->_IO_read_ptr;
95+
else
96+
{
97+
/* Need to handle a filebuf in write mode (switch to read mode). FIXME!*/
98+
--
99+
2.51.0
100+
Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
From 52a0be690747e3bf89218bf14e62837dfe2d1288 Mon Sep 17 00:00:00 2001
2+
From: Rocket Ma <marocketbd@gmail.com>
3+
Date: Fri, 17 Apr 2026 23:48:41 -0700
4+
Subject: [PATCH 3/3] stdio-common: Fix buffer overflow in scanf %mc [BZ
5+
#34008]
6+
7+
* stdio-common/vfscanf-internal.c: When enlarging allocated buffer with
8+
format %mc or %mC, glibc allocates one byte less, leading to
9+
user-controlled one byte overflow. This commit fixes BZ #34008, or
10+
CVE-2026-5450.
11+
12+
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
13+
Signed-off-by: Rocket Ma <marocketbd@gmail.com>
14+
Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@surgut.co.uk>
15+
---
16+
stdio-common/Makefile | 4 +++
17+
stdio-common/tst-vfscanf-bz34008.c | 48 ++++++++++++++++++++++++++++++
18+
stdio-common/vfscanf-internal.c | 7 ++---
19+
3 files changed, 55 insertions(+), 4 deletions(-)
20+
create mode 100644 stdio-common/tst-vfscanf-bz34008.c
21+
22+
diff --git a/stdio-common/Makefile b/stdio-common/Makefile
23+
index 210944837e..0c0085e607 100644
24+
--- a/stdio-common/Makefile
25+
+++ b/stdio-common/Makefile
26+
@@ -349,6 +349,7 @@ tests := \
27+
tst-vfprintf-user-type \
28+
tst-vfprintf-width-i18n \
29+
tst-vfprintf-width-prec-alloc \
30+
+ tst-vfscanf-bz34008 \
31+
tst-wc-printf \
32+
tstdiomisc \
33+
tstgetln \
34+
@@ -564,6 +565,9 @@ tst-printf-bz18872-ENV = MALLOC_TRACE=$(objpfx)tst-printf-bz18872.mtrace \
35+
tst-vfprintf-width-prec-ENV = \
36+
MALLOC_TRACE=$(objpfx)tst-vfprintf-width-prec.mtrace \
37+
LD_PRELOAD=$(common-objpfx)/malloc/libc_malloc_debug.so
38+
+tst-vfscanf-bz34008-ENV = \
39+
+ MALLOC_CHECK_=3 \
40+
+ LD_PRELOAD=$(common-objpfx)/malloc/libc_malloc_debug.so
41+
tst-printf-bz25691-ENV = \
42+
MALLOC_TRACE=$(objpfx)tst-printf-bz25691.mtrace \
43+
LD_PRELOAD=$(common-objpfx)/malloc/libc_malloc_debug.so
44+
diff --git a/stdio-common/tst-vfscanf-bz34008.c b/stdio-common/tst-vfscanf-bz34008.c
45+
new file mode 100644
46+
index 0000000000..48371c8a3d
47+
--- /dev/null
48+
+++ b/stdio-common/tst-vfscanf-bz34008.c
49+
@@ -0,0 +1,48 @@
50+
+/* Regression test for vfscanf %Nmc out-of-bound write (BZ #34008)
51+
+ Copyright (C) 2026 The GNU Toolchain Authors.
52+
+ This file is part of the GNU C Library.
53+
+
54+
+ The GNU C Library is free software; you can redistribute it and/or
55+
+ modify it under the terms of the GNU Lesser General Public
56+
+ License as published by the Free Software Foundation; either
57+
+ version 2.1 of the License, or (at your option) any later version.
58+
+
59+
+ The GNU C Library is distributed in the hope that it will be useful,
60+
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
61+
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
62+
+ Lesser General Public License for more details.
63+
+
64+
+ You should have received a copy of the GNU Lesser General Public
65+
+ License along with the GNU C Library; if not, see
66+
+ <https://www.gnu.org/licenses/>. */
67+
+
68+
+#include "malloc/mcheck.h"
69+
+#include <stddef.h>
70+
+#include <stdio.h>
71+
+#include <string.h>
72+
+#include <wchar.h>
73+
+#include <stdlib.h>
74+
+#include <malloc.h>
75+
+#include <support/check.h>
76+
+
77+
+#define WIDTH 0x410
78+
+#define SCANFSTR "%1040mc"
79+
+static int
80+
+do_test (void)
81+
+{
82+
+ mcheck_pedantic (NULL);
83+
+ char *input = malloc (WIDTH + 1);
84+
+ TEST_VERIFY (input != NULL);
85+
+ memset (input, 'A', WIDTH);
86+
+ input[WIDTH] = '\0';
87+
+
88+
+ char *buf = NULL;
89+
+ TEST_VERIFY (sscanf (input, SCANFSTR, &buf) != -1);
90+
+ TEST_VERIFY (buf != NULL);
91+
+
92+
+ free (buf);
93+
+ free (input);
94+
+ return 0;
95+
+}
96+
+
97+
+#include <support/test-driver.c>
98+
diff --git a/stdio-common/vfscanf-internal.c b/stdio-common/vfscanf-internal.c
99+
index 63b9246e47..8687150dff 100644
100+
--- a/stdio-common/vfscanf-internal.c
101+
+++ b/stdio-common/vfscanf-internal.c
102+
@@ -862,8 +862,7 @@ __vfscanf_internal (FILE *s, const char *format, va_list argptr,
103+
{
104+
/* Enlarge the buffer. */
105+
size_t newsize
106+
- = strsize
107+
- + (strsize >= width ? width - 1 : strsize);
108+
+ = strsize + (strsize >= width ? width : strsize);
109+
110+
str = (char *) realloc (*strptr, newsize);
111+
if (str == NULL)
112+
@@ -936,7 +935,7 @@ __vfscanf_internal (FILE *s, const char *format, va_list argptr,
113+
&& wstr == (wchar_t *) *strptr + strsize)
114+
{
115+
size_t newsize
116+
- = strsize + (strsize > width ? width - 1 : strsize);
117+
+ = strsize + (strsize >= width ? width : strsize);
118+
/* Enlarge the buffer. */
119+
wstr = (wchar_t *) realloc (*strptr,
120+
newsize * sizeof (wchar_t));
121+
@@ -991,7 +990,7 @@ __vfscanf_internal (FILE *s, const char *format, va_list argptr,
122+
&& wstr == (wchar_t *) *strptr + strsize)
123+
{
124+
size_t newsize
125+
- = strsize + (strsize > width ? width - 1 : strsize);
126+
+ = strsize + (strsize >= width ? width : strsize);
127+
/* Enlarge the buffer. */
128+
wstr = (wchar_t *) realloc (*strptr,
129+
newsize * sizeof (wchar_t));
130+
--
131+
2.51.0
132+

gn.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
package:
33
name: gn
44
version: "0.0_git20260501"
5-
epoch: 0
5+
epoch: 1
66
description: "Meta-build system that generates build files for Ninja"
77
copyright:
88
- license: BSD-3-Clause
@@ -26,7 +26,7 @@ pipeline:
2626
with:
2727
repository: https://gn.googlesource.com/gn.git
2828
branch: main
29-
expected-commit: eab8a9f92dca9b8548a89d9e5eb6aeb8ac6bba77
29+
expected-commit: 1740f5c25bcac5a650ee3d1c1ec22bfa25fcd756
3030

3131
- runs: |
3232
python${{vars.python-version}} build/gen.py

kargo.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package:
22
name: kargo
33
version: "1.9.6"
4-
epoch: 1 # GHSA-mh2q-q3fh-2475
4+
epoch: 2 # GHSA-pc3f-x583-g7j2
55
description: Application lifecycle orchestration
66
copyright:
77
- license: Apache-2.0
@@ -35,6 +35,7 @@ pipeline:
3535
github.com/docker/cli@v29.2.0
3636
google.golang.org/grpc@v1.79.3
3737
go.opentelemetry.io/otel@v1.41.0
38+
github.com/moby/spdystream@v0.5.1
3839
modroot: hack/tools
3940
tidy: false
4041

@@ -47,6 +48,7 @@ pipeline:
4748
github.com/go-git/go-git/v5@v5.17.1
4849
github.com/go-jose/go-jose/v4@v4.1.4
4950
go.opentelemetry.io/otel@v1.41.0
51+
github.com/moby/spdystream@v0.5.1
5052
5153
- runs: |
5254
cd ui

postgresql-16.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package:
22
name: postgresql-16
33
version: "16.13"
4-
epoch: 6
4+
epoch: 7 # go/wolfi-rsc/postgresql-16
55
description: A sophisticated object-relational DBMS
66
copyright:
77
- license: BSD-3-Clause
@@ -13,8 +13,11 @@ package:
1313
- ecpg=${{package.full-version}}
1414
- tzdata
1515
resources:
16-
cpu: "9"
16+
cpu: "5"
1717
memory: 14Gi
18+
test-resources:
19+
cpu: "1"
20+
memory: 4Gi
1821

1922
environment:
2023
environment:

py3-pymysql.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package:
22
name: py3-pymysql
3-
version: "1.1.2"
4-
epoch: 2 # go/wolfi-rsc/py3-pymysql
3+
version: "1.1.3"
4+
epoch: 0 # go/wolfi-rsc/py3-pymysql
55
description: Pure Python MySQL Driver
66
copyright:
77
- license: MIT
@@ -34,7 +34,7 @@ pipeline:
3434
with:
3535
repository: https://github.com/PyMySQL/PyMySQL
3636
tag: v${{package.version}}
37-
expected-commit: d7bb777e503d82bf2496113f07dd4ab249615efc
37+
expected-commit: 5613187f54fd524a009a340f50b160c644899706
3838

3939
subpackages:
4040
- range: py-versions

renovate.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package:
22
name: renovate
3-
version: "43.160.2"
3+
version: "43.160.4"
44
epoch: 0
55
description: "Automated dependency updates. Multi-platform and multi-language."
66
copyright:
@@ -39,7 +39,7 @@ pipeline:
3939
with:
4040
repository: https://github.com/renovatebot/renovate
4141
tag: ${{package.version}}
42-
expected-commit: ca23fd14ded0783b5978205df51dc09ff7a2633a
42+
expected-commit: 26ba9fde6b973209945b83417d68579be64d6b16
4343

4444
- runs: |
4545
sed -i 's/"version": "0.0.0-semantic-release"/"version": "${{package.version}}"/' package.json

ruby3.3-fluentd-kubernetes-daemonset-1.19.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package:
22
# fluentd supported versions: https://github.com/fluent/fluentd/blob/master/SECURITY.md
33
# The kubernetes daemonset trails fluentd releases by a bit
44
name: ruby3.3-fluentd-kubernetes-daemonset-1.19
5-
version: "1.19.2.1.4"
5+
version: "1.19.2.1.5"
66
epoch: 0 # go/wolfi-rsc/ruby3.3-fluentd-kubernetes-daemonset-1.19
77
description: Fluentd ${{vars.fluentdMM}} daemonset for Kubernetes
88
copyright:
@@ -51,7 +51,7 @@ data:
5151
pipeline:
5252
- uses: git-checkout
5353
with:
54-
expected-commit: 6693e712bbe39cbf472bbfa71141ed21bd631b9f
54+
expected-commit: f5a6ce26005449fb63d2cd46c2c417a29463f520
5555
repository: https://github.com/fluent/fluentd-kubernetes-daemonset.git
5656
tag: v${{vars.mangled-package-version}}
5757

0 commit comments

Comments
 (0)