Skip to content

Commit 1bb81db

Browse files
[AUTO-CHERRYPICK] busybox: Address CVE-2023-42366 - branch main (#11122)
Co-authored-by: Ankita Pareek <56152556+Ankita13-code@users.noreply.github.com>
1 parent 70ac1cd commit 1bb81db

2 files changed

Lines changed: 38 additions & 2 deletions

File tree

SPECS/busybox/CVE-2023-42366.patch

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
From 5cf8b332429a1dd9afef3337bae92aeddaeff993 Mon Sep 17 00:00:00 2001
2+
From: Valery Ushakov <uwe@stderr.spb.ru>
3+
Date: Wed, 24 Jan 2024 22:24:41 +0300
4+
Subject: [PATCH] awk.c: fix CVE-2023-42366 (bug #15874)
5+
6+
Make sure we don't read past the end of the string in next_token()
7+
when backslash is the last character in an (invalid) regexp.
8+
---
9+
editors/awk.c | 6 ++++--
10+
1 file changed, 4 insertions(+), 2 deletions(-)
11+
12+
diff --git a/editors/awk.c b/editors/awk.c
13+
index 728ee8685..be48df7c7 100644
14+
--- a/editors/awk.c
15+
+++ b/editors/awk.c
16+
@@ -1165,9 +1165,11 @@ static uint32_t next_token(uint32_t expected)
17+
s[-1] = bb_process_escape_sequence((const char **)&pp);
18+
if (*p == '\\')
19+
*s++ = '\\';
20+
- if (pp == p)
21+
+ if (pp == p) {
22+
+ if (*p == '\0')
23+
+ syntax_error(EMSG_UNEXP_EOS);
24+
*s++ = *p++;
25+
- else
26+
+ } else
27+
p = pp;
28+
}
29+
}
30+
--
31+
2.34.1
32+

SPECS/busybox/busybox.spec

Lines changed: 6 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: 11%{?dist}
4+
Release: 12%{?dist}
55
License: GPLv2
66
Vendor: Microsoft Corporation
77
Distribution: Mariner
@@ -18,9 +18,10 @@ Patch5: ash-fix-use-after-free-in-bash-pattern-substitution.patch
1818
Patch6: selinux-copy-file.patch
1919
Patch7: selinux-cp-a.patch
2020
Patch8: CVE-2021-42380.patch
21-
# Also Fixes CVE-2023-42364
2221
Patch9: CVE-2023-42363.patch
22+
# Also Fixes CVE-2023-42364
2323
Patch10: CVE-2023-42365.patch
24+
Patch11: CVE-2023-42366.patch
2425
BuildRequires: gcc
2526
BuildRequires: glibc-static >= 2.35-7%{?dist}
2627
BuildRequires: libselinux-devel >= 1.27.7-2
@@ -100,6 +101,9 @@ install -m 644 docs/busybox.petitboot.1 %{buildroot}/%{_mandir}/man1/busybox.pet
100101
%{_mandir}/man1/busybox.petitboot.1.gz
101102

102103
%changelog
104+
* Fri Nov 15 2024 Ankita Pareek <ankitapareek@microsoft.com> - 1.35.0-12
105+
- Address CVE-2023-42366
106+
103107
* Tue Aug 13 2024 Suresh Thelkar <sthelkar@microsoft.com> - 1.35.0-11
104108
- Address CVE-2021-42380, CVE-2023-42363, CVE-2023-42364 & CVE-2023-42365
105109

0 commit comments

Comments
 (0)