summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/recipes-core/musl/musl/CVE-2025-26519-1.patch39
-rw-r--r--meta/recipes-core/musl/musl/CVE-2025-26519-2.patch38
-rw-r--r--meta/recipes-core/musl/musl_git.bb4
3 files changed, 80 insertions, 1 deletions
diff --git a/meta/recipes-core/musl/musl/CVE-2025-26519-1.patch b/meta/recipes-core/musl/musl/CVE-2025-26519-1.patch
new file mode 100644
index 0000000000..5583c5f6cc
--- /dev/null
+++ b/meta/recipes-core/musl/musl/CVE-2025-26519-1.patch
@@ -0,0 +1,39 @@
1From 8ebb2a68dfac02e7a83885587a9a5a203147ebbe Mon Sep 17 00:00:00 2001
2From: Rich Felker <dalias@aerifal.cx>
3Date: Wed, 19 Nov 2025 13:23:38 +0100
4Subject: [PATCH] iconv: fix erroneous input validation in EUC-KR decoder
5
6as a result of incorrect bounds checking on the lead byte being
7decoded, certain invalid inputs which should produce an encoding
8error, such as "\xc8\x41", instead produced out-of-bounds loads from
9the ksc table.
10
11in a worst case, the loaded value may not be a valid unicode scalar
12value, in which case, if the output encoding was UTF-8, wctomb would
13return (size_t)-1, causing an overflow in the output pointer and
14remaining buffer size which could clobber memory outside of the output
15buffer.
16
17bug report was submitted in private by Nick Wellnhofer on account of
18potential security implications.
19
20CVE: CVE-2025-26519
21Upstream-Status: Backport [https://git.musl-libc.org/cgit/musl/commit/?id=e5adcd97b5196e29991b524237381a0202a60659]
22Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
23---
24 src/locale/iconv.c | 2 +-
25 1 file changed, 1 insertion(+), 1 deletion(-)
26
27diff --git a/src/locale/iconv.c b/src/locale/iconv.c
28index 3047c27b..1fb66bc8 100644
29--- a/src/locale/iconv.c
30+++ b/src/locale/iconv.c
31@@ -495,7 +495,7 @@ size_t iconv(iconv_t cd, char **restrict in, size_t *restrict inb, char **restri
32 if (c >= 93 || d >= 94) {
33 c += (0xa1-0x81);
34 d += 0xa1;
35- if (c >= 93 || c>=0xc6-0x81 && d>0x52)
36+ if (c > 0xc6-0x81 || c==0xc6-0x81 && d>0x52)
37 goto ilseq;
38 if (d-'A'<26) d = d-'A';
39 else if (d-'a'<26) d = d-'a'+26;
diff --git a/meta/recipes-core/musl/musl/CVE-2025-26519-2.patch b/meta/recipes-core/musl/musl/CVE-2025-26519-2.patch
new file mode 100644
index 0000000000..7d193ab241
--- /dev/null
+++ b/meta/recipes-core/musl/musl/CVE-2025-26519-2.patch
@@ -0,0 +1,38 @@
1From 7e7052e17e900194a588d337ff4a8e646133afed Mon Sep 17 00:00:00 2001
2From: Rich Felker <dalias@aerifal.cx>
3Date: Wed, 19 Nov 2025 13:27:15 +0100
4Subject: [PATCH] iconv: harden UTF-8 output code path against input decoder
5 bugs
6
7the UTF-8 output code was written assuming an invariant that iconv's
8decoders only emit valid Unicode Scalar Values which wctomb can encode
9successfully, thereby always returning a value between 1 and 4.
10
11if this invariant is not satisfied, wctomb returns (size_t)-1, and the
12subsequent adjustments to the output buffer pointer and remaining
13output byte count overflow, moving the output position backwards,
14potentially past the beginning of the buffer, without storing any
15bytes.
16
17CVE: CVE-2025-26519
18Upstream-Status: Backport [https://git.musl-libc.org/cgit/musl/commit/?id=c47ad25ea3b484e10326f933e927c0bc8cded3da]
19Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
20---
21 src/locale/iconv.c | 4 ++++
22 1 file changed, 4 insertions(+)
23
24diff --git a/src/locale/iconv.c b/src/locale/iconv.c
25index 1fb66bc8..fb1d3217 100644
26--- a/src/locale/iconv.c
27+++ b/src/locale/iconv.c
28@@ -538,6 +538,10 @@ size_t iconv(iconv_t cd, char **restrict in, size_t *restrict inb, char **restri
29 if (*outb < k) goto toobig;
30 memcpy(*out, tmp, k);
31 } else k = wctomb_utf8(*out, c);
32+ /* This failure condition should be unreachable, but
33+ * is included to prevent decoder bugs from translating
34+ * into advancement outside the output buffer range. */
35+ if (k>4) goto ilseq;
36 *out += k;
37 *outb -= k;
38 break;
diff --git a/meta/recipes-core/musl/musl_git.bb b/meta/recipes-core/musl/musl_git.bb
index 324269a968..bc516b6183 100644
--- a/meta/recipes-core/musl/musl_git.bb
+++ b/meta/recipes-core/musl/musl_git.bb
@@ -14,7 +14,9 @@ SRC_URI = "git://git.etalabs.net/git/musl;branch=master;protocol=https \
14 file://0001-Make-dynamic-linker-a-relative-symlink-to-libc.patch \ 14 file://0001-Make-dynamic-linker-a-relative-symlink-to-libc.patch \
15 file://0002-ldso-Use-syslibdir-and-libdir-as-default-pathes-to-l.patch \ 15 file://0002-ldso-Use-syslibdir-and-libdir-as-default-pathes-to-l.patch \
16 file://0003-elf.h-add-typedefs-for-Elf64_Relr-and-Elf32_Relr.patch \ 16 file://0003-elf.h-add-typedefs-for-Elf64_Relr-and-Elf32_Relr.patch \
17 " 17 file://CVE-2025-26519-1.patch \
18 file://CVE-2025-26519-2.patch \
19 "
18 20
19S = "${WORKDIR}/git" 21S = "${WORKDIR}/git"
20 22