Fix Busybox CVEs and bump to 1.37.0
cover Fix Busybox CVEs and bump to 1.37.0
Hello,
This series started from the proposed Busybox 1.37.0 bump from Clément Ramirez, and was expanded to address other Busybox issues.
First, we fix the remaining CVEs that affect 1.36.1. Since the backport from upstreaming was a bit tedious, we took advantage of the backports that OpenEmbedded had already done. This will allow those security fixes to be easily backport to 2024.02.x, without having to bump to 1.37.0.
We also fix a build issue on RISC-V 32-bit musl configurations, by using another patch from meta-riscv.
And finally, we do the bump to 1.37.0. Compared to Clément's previous submission, we adjusted on top of the previous patches, we added a fix for the syslogd issue reported by Bernd, and we improved the commit log.
The Busybox CI tests are passing:
15:02:43 TestInitSystemBusyboxRwNet Starting 15:02:44 TestInitSystemBusyboxRwNet Building 15:05:58 TestInitSystemBusyboxRwNet Building done 15:06:04 TestInitSystemBusyboxRwNet Cleaning up .15:06:04 TestInitSystemBusyboxRw Starting 15:06:05 TestInitSystemBusyboxRw Building 15:09:19 TestInitSystemBusyboxRw Building done 15:09:25 TestInitSystemBusyboxRw Cleaning up .15:09:25 TestInitSystemBusyboxRoNet Starting 15:09:26 TestInitSystemBusyboxRoNet Building 15:12:29 TestInitSystemBusyboxRoNet Building done 15:12:35 TestInitSystemBusyboxRoNet Cleaning up .15:12:35 TestInitSystemBusyboxRo Starting 15:12:36 TestInitSystemBusyboxRo Building 15:15:38 TestInitSystemBusyboxRo Building done 15:15:44 TestInitSystemBusyboxRo Cleaning up
.
Ran 4 tests in 781.049s
OK
Clement Ramirez (1):
package/busybox bump version to 1.37.0
Thomas Petazzoni (3):
package/busybox: fix patch 0009 formatting package/busybox: fix pending CVEs
package/busybox: fix hwclock build issue on RISC-V 32-bit musl configs
...route-use-linux-if_packet.h-instead-.patch | 10 +-
...trip-non-l-arguments-returned-by-pkg.patch | 15 ++-
...tr-ensure-only-printable-characters-.patch | 4 +-
...e-all-printed-strings-with-printable.patch | 16 +--
...r-glibc-2.24-not-providing-getrandom.patch | 39 -------
...random-detection-for-non-glibc-libc.patch} | 30 +----
...failing-saying-ncurses-is-not-found.patch} | 18 +--
...glibc-2.24-not-providing-random-head.patch | 60 ----------
...Fix-compilation-with-Linux-v6.8-rc1.patch} | 4 +-
...8-awk.c-fix-CVE-2023-42366-bug-15874.patch | 43 ++++++++
...CH-and-SIGCHLD-in-hush-interrupting-.patch | 103 ------------------
...r-SYS_settimeofday-before-calling-sy.patch | 54 +++++++++
...0-libbb-sha-add-missing-sha-NI-guard.patch | 54 +++++++++
...ix-wrong-OPT_locallog-flag-detection.patch | 37 +++++++
package/busybox/busybox.hash | 4 +-
package/busybox/busybox.mk | 12 +-
16 files changed, 240 insertions(+), 263 deletions(-)
delete mode 100644 package/busybox/0005-seedrng-fix-for-glibc-2.24-not-providing-getrandom.patch
rename package/busybox/{0007-seedrng-fix-getrandom-detection-for-non-glibc-libc.patch => 0005-seedrng-fix-getrandom-detection-for-non-glibc-libc.patch} (81%)
rename package/busybox/{0009-menuconfig-gcc-failing-saying-ncurses-is-not-found.patch => 0006-menuconfig-GCC-failing-saying-ncurses-is-not-found.patch} (79%)
delete mode 100644 package/busybox/0006-seedrng-fix-for-glibc-2.24-not-providing-random-head.patch
rename package/busybox/{0010-Linux-v6.8-rc1-removed-the-definitions-related-to-CB.patch => 0007-tc-Fix-compilation-with-Linux-v6.8-rc1.patch} (96%)
create mode 100644 package/busybox/0008-awk.c-fix-CVE-2023-42366-bug-15874.patch
delete mode 100644 package/busybox/0008-shell-fix-SIGWINCH-and-SIGCHLD-in-hush-interrupting-.patch
create mode 100644 package/busybox/0009-hwclock-Check-for-SYS_settimeofday-before-calling-sy.patch
create mode 100644 package/busybox/0010-libbb-sha-add-missing-sha-NI-guard.patch
create mode 100644 package/busybox/0011-syslogd-fix-wrong-OPT_locallog-flag-detection.patchSignature · 6 lines
2.48.1 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH 1/4 package/busybox: fix patch 0009 formatting
As it is, patch 0009 cannot be applied with "git am", so fix its format.
--- ...c-failing-saying-ncurses-is-not-found.patch | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
package/busybox/0009-menuconfig-gcc-failing-saying-ncurses-is-not-found.patch +9 -9
@@ -1,6 +1,6 @@ -From [email protected] Sun Jul 21 12:10:52 2024 -From: [email protected] (Nop) -Date: Sun, 21 Jul 2024 14:10:52 +0200 +From 32949508fe566aee8988cb6d8ee101ecc5e49a65 Mon Sep 17 00:00:00 2001 +From: ctxnop <[email protected]> +Date: Sun, 26 Jan 2025 20:59:20 +0100 Subject: [PATCH] menuconfig: GCC failing saying ncurses is not found Newer GCC increased diagnostics levels resulting in considering the
@@ -17,13 +17,12 @@ Signed-off-by: Fiona Klute (WIWA) <[email protected]> scripts/kconfig/lxdialog/check-lxdialog.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -diff --git a/scripts/kconfig/lxdialog/check-lxdialog.sh -b/scripts/kconfig/lxdialog/check-lxdialog.sh -index 5075ebf2d..c644d1d48 100755 +diff --git a/scripts/kconfig/lxdialog/check-lxdialog.sh b/scripts/kconfig/lxdialog/check-lxdialog.sh +index 5075ebf2d..08e4da3de 100755 --- a/scripts/kconfig/lxdialog/check-lxdialog.sh +++ b/scripts/kconfig/lxdialog/check-lxdialog.sh @@ -45,9 +45,9 @@ trap "rm -f $tmp" 0 1 2 3 15 - + # Check if we can link to ncurses check() { - $cc -x c - -o $tmp 2>/dev/null <<'EOF'
@@ -34,5 +33,6 @@ index 5075ebf2d..c644d1d48 100755 EOF if [ $? != 0 ]; then echo " *** Unable to find the ncurses libraries or the" 1>&2 --- -2.45.2 +-- +2.47.1 +
Signature · 6 lines
2.48.1 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Re: [Buildroot] [PATCH 1/4] package/busybox: fix patch 0009 formatting
Quoted 6 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Thomas" == Thomas Petazzoni via buildroot <[email protected]> writes:
As it is, patch 0009 cannot be applied with "git am", so fix its format.
Signed-off-by Thomas Petazzoni <[email protected]>
Committed, thanks.
Signature · 5 lines
Bye, Peter Korsgaard _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Re: [Buildroot] [PATCH 1/4] package/busybox: fix patch 0009 formatting
In reply to Thomas Petazzoni via buildrootQuoted 6 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Thomas" == Thomas Petazzoni via buildroot <[email protected]> writes:
As it is, patch 0009 cannot be applied with "git am", so fix its format.
Signed-off-by Thomas Petazzoni <[email protected]>
Committed to 2024.02.x and 2024.11.x, thanks.
Signature · 5 lines
Bye, Peter Korsgaard _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH 2/4 package/busybox: fix pending CVEs
In reply to Thomas Petazzoni via buildrootThis commit adds patches, which were all backported from upstream, or submitted upstream, and that fix various CVEs. To facilitate the backporting work, we took the backports from openembedded-core.
CVE-2021-42380: this one is not marked by NVD as affecting 1.36.1, but its fix was merged after 1.36.1, so it seems like the NVD data is incorrect. Therefore, no need for a BUSYBOX_IGNORE_CVES entry. Patch is upstream, backport taken from openembedded-core.
CVE-2023-42363, CVE-2023-42364, CVE-2023-42365: patches are upstream, backports taken from openembedded-core.
CVE-2023-42366: patch has been submitted upstream but not merged, patch taken from openembedded-core.
--- ...r-realloc-CVE-2021-42380-closes-1560.patch | 154 +++++++++++++ ...wk-fix-use-after-free-CVE-2023-42363.patch | 70 ++++++ ...13-awk-fix-precedence-of-relative-to.patch | 203 ++++++++++++++++++ ...x-ternary-operator-and-precedence-of.patch | 102 +++++++++ ...5-awk.c-fix-CVE-2023-42366-bug-15874.patch | 43 ++++ package/busybox/busybox.mk | 10 + 6 files changed, 582 insertions(+) create mode 100644 package/busybox/0011-awk-fix-use-after-realloc-CVE-2021-42380-closes-1560.patch create mode 100644 package/busybox/0012-awk-fix-use-after-free-CVE-2023-42363.patch create mode 100644 package/busybox/0013-awk-fix-precedence-of-relative-to.patch create mode 100644 package/busybox/0014-awk-fix-ternary-operator-and-precedence-of.patch create mode 100644 package/busybox/0015-awk.c-fix-CVE-2023-42366-bug-15874.patch
package/busybox/0011-awk-fix-use-after-realloc-CVE-2021-42380-closes-1560.patch new file +154 -0
@@ -0,0 +1,154 @@ +From 7c73cdaa80faf0046b07c970321557ff04f7da64 Mon Sep 17 00:00:00 2001 +From: Denys Vlasenko <[email protected]> +Date: Fri, 26 May 2023 19:36:58 +0200 +Subject: [PATCH] awk: fix use-after-realloc (CVE-2021-42380), closes 15601 + +Signed-off-by: Denys Vlasenko <[email protected]> + +CVE: CVE-2021-42380 +Upstream-Status: Backport [https://git.busybox.net/busybox/commit/?id=5dcc443dba039b305a510c01883e9f34e42656ae] +Signed-off-by: Peter Marko <[email protected]> +[Thomas: taken from https://git.openembedded.org/openembedded-core/tree/meta/recipes-core/busybox/busybox/CVE-2021-42380.patch?id=e0ff4813b1cf4df0d851c857d57fb88d7db51bdd] +Upstream: https://git.busybox.net/busybox/commit/?id=5dcc443dba039b305a510c01883e9f34e42656ae +Signed-off-by: Thomas Petazzoni <[email protected]> +--- + editors/awk.c | 26 ++++++++++++++++----- + testsuite/awk.tests | 55 +++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 75 insertions(+), 6 deletions(-) + +diff --git a/editors/awk.c b/editors/awk.c +index 728ee8685..2af823808 100644 +--- a/editors/awk.c ++++ b/editors/awk.c +@@ -555,7 +555,7 @@ struct globals { + const char *g_progname; + int g_lineno; + int nfields; +- int maxfields; /* used in fsrealloc() only */ ++ unsigned maxfields; + var *Fields; + char *g_pos; + char g_saved_ch; +@@ -1931,9 +1931,9 @@ static void fsrealloc(int size) + { + int i, newsize; + +- if (size >= maxfields) { +- /* Sanity cap, easier than catering for overflows */ +- if (size > 0xffffff) ++ if ((unsigned)size >= maxfields) { ++ /* Sanity cap, easier than catering for over/underflows */ ++ if ((unsigned)size > 0xffffff) + bb_die_memory_exhausted(); + + i = maxfields; +@@ -2891,6 +2891,7 @@ static var *evaluate(node *op, var *res) + uint32_t opinfo; + int opn; + node *op1; ++ var *old_Fields_ptr; + + opinfo = op->info; + opn = (opinfo & OPNMASK); +@@ -2899,10 +2900,16 @@ static var *evaluate(node *op, var *res) + debug_printf_eval("opinfo:%08x opn:%08x\n", opinfo, opn); + + /* execute inevitable things */ ++ old_Fields_ptr = NULL; + if (opinfo & OF_RES1) { + if ((opinfo & OF_REQUIRED) && !op1) + syntax_error(EMSG_TOO_FEW_ARGS); + L.v = evaluate(op1, TMPVAR0); ++ /* Does L.v point to $n variable? */ ++ if ((size_t)(L.v - Fields) < maxfields) { ++ /* yes, remember where Fields[] is */ ++ old_Fields_ptr = Fields; ++ } + if (opinfo & OF_STR1) { + L.s = getvar_s(L.v); + debug_printf_eval("L.s:'%s'\n", L.s); +@@ -2921,8 +2928,15 @@ static var *evaluate(node *op, var *res) + */ + if (opinfo & OF_RES2) { + R.v = evaluate(op->r.n, TMPVAR1); +- //TODO: L.v may be invalid now, set L.v to NULL to catch bugs? +- //L.v = NULL; ++ /* Seen in $5=$$5=$0: ++ * Evaluation of R.v ($$5=$0 expression) ++ * made L.v ($5) invalid. It's detected here. ++ */ ++ if (old_Fields_ptr) { ++ //if (old_Fields_ptr != Fields) ++ // debug_printf_eval("L.v moved\n"); ++ L.v += Fields - old_Fields_ptr; ++ } + if (opinfo & OF_STR2) { + R.s = getvar_s(R.v); + debug_printf_eval("R.s:'%s'\n", R.s); +diff --git a/testsuite/awk.tests b/testsuite/awk.tests +index bbf0fbff1..ddc51047b 100755 +--- a/testsuite/awk.tests ++++ b/testsuite/awk.tests +@@ -485,4 +485,59 @@ testing 'awk assign while test' \ + "" \ + "foo" + ++# User-supplied bug (SEGV) example, was causing use-after-realloc ++testing 'awk assign while assign' \ ++ "awk '\$5=\$\$5=\$0'; echo \$?" \ ++ "\ ++─ process timing ────────────────────────────────────┬─ ─ process timing ────────────────────────────────────┬─ overall results ────┐ results ────┐ ++│ run time : │ run time : 0 days, 0 hrs, 0 min, 56 sec │ cycles done : 0 │ days, 0 hrs, 0 min, 56 sec │ cycles done : 0 │ ++│ last new find │ last new find : 0 days, 0 hrs, 0 min, 1 sec │ corpus count : 208 │ 0 days, 0 hrs, 0 min, 1 sec │ corpus count : 208 │ ++│last saved crash : │last saved crash : none seen yet │saved crashes : 0 │ seen yet │saved crashes : 0 │ ++│ last saved hang │ last saved hang : none seen yet │ saved hangs : 0 │ none seen yet │ saved hangs : 0 │ ++├─ cycle progress ─────────────────────┬─ ├─ cycle progress ─────────────────────┬─ map coverage┴──────────────────────┤ coverage┴──────────────────────┤ ++│ now processing : │ now processing : 184.1 (88.5%) │ map density : 0.30% / 0.52% │ (88.5%) │ map density : 0.30% / 0.52% │ │ now processing : 184.1 (88.5%) │ map density : 0.30% / 0.52% │ ++│ runs timed out │ runs timed out : 0 (0.00%) │ count coverage : 2.18 bits/tuple │ 0 (0.00%) │ count coverage : 2.18 bits/tuple │ ++├─ stage progress ─────────────────────┼─ ├─ stage progress ─────────────────────┼─ findings in depth ─────────────────┤ in depth ─────────────────┤ ++│ now trying : │ now trying : havoc │ favored items : 43 (20.67%) │ │ favored items : 43 (20.67%) │ ++│ stage execs : │ stage execs : 11.2k/131k (8.51%) │ new edges on : 52 (25.00%) │ (8.51%) │ new edges on │ stage execs : 11.2k/131k (8.51%) │ new edges on : 52 (25.00%) │ 52 (25.00%) │ ++│ total execs : │ total execs : 179k │ total crashes : 0 (0 saved) │ │ total crashes : 0 (0 saved) │ │ total execs : 179k │ total crashes : 0 (0 saved) │ ++│ exec speed : │ exec speed : 3143/sec │ total tmouts : 0 (0 saved) │ │ total tmouts : 0 (0 saved) │ │ exec speed : 3143/sec │ total tmouts : 0 (0 saved) │ ++├─ fuzzing strategy yields ├─ fuzzing strategy yields ────────────┴─────────────┬─ item geometry ───────┤ item geometry ───────┤ ++│ bit flips : │ bit flips : 11/648, 4/638, 5/618 │ levels : 4 │ 4/638, 5/618 │ levels : │ bit flips : 11/648, 4/638, 5/618 │ levels : 4 │ │ ++│ byte flips : │ byte flips : 0/81, 0/71, 0/52 │ pending : 199 │ 0/71, 0/52 │ pending : 199 │ ++│ arithmetics : 11/4494, │ arithmetics : 11/4494, 0/1153, 0/0 │ pend fav : 35 │ 0/0 │ pend fav : 35 │ ++│ known ints : 1/448, 0/1986, 0/2288 │ own finds : 207 │ known ints : │ known ints : 1/448, 0/1986, 0/2288 │ own finds : 207 │ 0/1986, 0/2288 │ own finds : 207 │ ++│ dictionary : 0/0, │ dictionary : 0/0, 0/0, 0/0, 0/0 │ imported : 0 │ 0/0, 0/0 │ imported : 0 │ ++│havoc/splice : 142/146k, 23/7616 │havoc/splice : 142/146k, 23/7616 │ stability : 100.00% │ stability : 100.00% │ ++│py/custom/rq : unused, unused, │py/custom/rq : unused, unused, unused, unused ├───────────────────────┘ unused ├───────────────────────┘ ++│ trim/eff : 57.02%/26, │ trim/eff : 57.02%/26, 0.00% │ [cpu000:100%] │ [cpu000:100%] ++└────────────────────────────────────────────────────┘^C └────────────────────────────────────────────────────┘^C ++0 ++" \ ++ "" \ ++ "\ ++─ process timing ────────────────────────────────────┬─ overall results ────┐ ++│ run time : 0 days, 0 hrs, 0 min, 56 sec │ cycles done : 0 │ ++│ last new find : 0 days, 0 hrs, 0 min, 1 sec │ corpus count : 208 │ ++│last saved crash : none seen yet │saved crashes : 0 │ ++│ last saved hang : none seen yet │ saved hangs : 0 │ ++├─ cycle progress ─────────────────────┬─ map coverage┴──────────────────────┤ ++│ now processing : 184.1 (88.5%) │ map density : 0.30% / 0.52% │ ++│ runs timed out : 0 (0.00%) │ count coverage : 2.18 bits/tuple │ ++├─ stage progress ─────────────────────┼─ findings in depth ─────────────────┤ ++│ now trying : havoc │ favored items : 43 (20.67%) │ ++│ stage execs : 11.2k/131k (8.51%) │ new edges on : 52 (25.00%) │ ++│ total execs : 179k │ total crashes : 0 (0 saved) │ ++│ exec speed : 3143/sec │ total tmouts : 0 (0 saved) │ ++├─ fuzzing strategy yields ────────────┴─────────────┬─ item geometry ───────┤ ++│ bit flips : 11/648, 4/638, 5/618 │ levels : 4 │ ++│ byte flips : 0/81, 0/71, 0/52 │ pending : 199 │ ++│ arithmetics : 11/4494, 0/1153, 0/0 │ pend fav : 35 │ ++│ known ints : 1/448, 0/1986, 0/2288 │ own finds : 207 │ ++│ dictionary : 0/0, 0/0, 0/0, 0/0 │ imported : 0 │ ++│havoc/splice : 142/146k, 23/7616 │ stability : 100.00% │ ++│py/custom/rq : unused, unused, unused, unused ├───────────────────────┘ ++│ trim/eff : 57.02%/26, 0.00% │ [cpu000:100%] ++└────────────────────────────────────────────────────┘^C" ++ + exit $FAILCOUNT +-- +2.47.1 +
package/busybox/0012-awk-fix-use-after-free-CVE-2023-42363.patch new file +70 -0
70 lines not on this page · raw message
package/busybox/0013-awk-fix-precedence-of-relative-to.patch new file +203 -0
203 lines not on this page · raw message
package/busybox/0014-awk-fix-ternary-operator-and-precedence-of.patch new file +102 -0
102 lines not on this page · raw message
package/busybox/0015-awk.c-fix-CVE-2023-42366-bug-15874.patch new file +43 -0
43 lines not on this page · raw message
package/busybox/busybox.mk +10 -0
@@ -15,6 +15,16 @@ BUSYBOX_CPE_ID_VENDOR = busybox # 0004-nslookup-sanitize-all-printed-strings-with-printable.patch BUSYBOX_IGNORE_CVES += CVE-2022-28391 +# 0012-awk-fix-use-after-free-CVE-2023-42363.patch +BUSYBOX_IGNORE_CVES += CVE-2023-42363 + +# 0013-awk-fix-precedence-of-relative-to.patch +# 0014-awk-fix-ternary-operator-and-precedence-of.patch +BUSYBOX_IGNORE_CVES += CVE-2023-42364 CVE-2023-42365 + +# 0015-awk.c-fix-CVE-2023-42366-bug-15874.patch +BUSYBOX_IGNORE_CVES += CVE-2023-42366 + BUSYBOX_CFLAGS = \ $(TARGET_CFLAGS)
Signature · 6 lines
2.48.1 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Re: [Buildroot] [PATCH 2/4] package/busybox: fix pending CVEs
Quoted 11 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Thomas" == Thomas Petazzoni via buildroot <[email protected]> writes:
This commit adds patches, which were all backported from upstream, or submitted upstream, and that fix various CVEs. To facilitate the backporting work, we took the backports from openembedded-core.
CVE-2021-42380: this one is not marked by NVD as affecting 1.36.1, but its fix was merged after 1.36.1, so it seems like the NVD data is incorrect. Therefore, no need for a
BUSYBOX_IGNORE_CVESentry. Patch is upstream, backport taken from openembedded-core.
Quoted 7 lines
CVE-2023-42363, CVE-2023-42364, CVE-2023-42365: patches are upstream, backports taken from openembedded-core.
CVE-2023-42366: patch has been submitted upstream but not merged, patch taken from openembedded-core.
Signed-off-by Thomas Petazzoni <[email protected]>
Committed, thanks.
Signature · 5 lines
Bye, Peter Korsgaard _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Re: [Buildroot] [PATCH 2/4] package/busybox: fix pending CVEs
In reply to Thomas Petazzoni via buildrootQuoted 11 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Thomas" == Thomas Petazzoni via buildroot <[email protected]> writes:
This commit adds patches, which were all backported from upstream, or submitted upstream, and that fix various CVEs. To facilitate the backporting work, we took the backports from openembedded-core.
CVE-2021-42380: this one is not marked by NVD as affecting 1.36.1, but its fix was merged after 1.36.1, so it seems like the NVD data is incorrect. Therefore, no need for a
BUSYBOX_IGNORE_CVESentry. Patch is upstream, backport taken from openembedded-core.
Quoted 7 lines
CVE-2023-42363, CVE-2023-42364, CVE-2023-42365: patches are upstream, backports taken from openembedded-core.
CVE-2023-42366: patch has been submitted upstream but not merged, patch taken from openembedded-core.
Signed-off-by Thomas Petazzoni <[email protected]>
Committed to 2024.02.x and 2024.11.x, thanks.
Signature · 5 lines
Bye, Peter Korsgaard _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH 3/4 package/busybox: fix hwclock build issue on RISC-V 32-bit musl configs
In reply to Thomas Petazzoni via buildrootTake a patch from meta-riscv, which was submitted upstream by Khem Raj to fix a build issue on RISC-V 32-bit musl configurations. This issue has been discussed with musl developers who believe this is a Busybox issue. The patch from Khem works around the issue by making it a runtime failure just affecting hwclock on RISC-V 32-bit musl instead of a build failure. The correct fix is not really clear, as there seems to be a disagreement between Busybox people and musl people on what the C library settimeofday() function should do, and that's why Busybox is bypassing settimeofday() on musl by making a direct system call, except this system call doesn't exist on RISC-V 32-bit.
In the mean time, this patch fixes the long standing Gitlab CI issue:
- tests.toolchain.test_external_bootlin.TestExternalToolchainBootlinRiscv32ilp32dMuslStable
https://gitlab.com/buildroot.org/buildroot/-/jobs/8954291684
- tests.toolchain.test_external_bootlin.TestExternalToolchainBootlinRiscv32ilp32dMuslBleedingEdge
https://gitlab.com/buildroot.org/buildroot/-/jobs/8954291683
--- ...r-SYS_settimeofday-before-calling-sy.patch | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 package/busybox/0016-hwclock-Check-for-SYS_settimeofday-before-calling-sy.patch
package/busybox/0016-hwclock-Check-for-SYS_settimeofday-before-calling-sy.patch new file +54 -0
@@ -0,0 +1,54 @@ +From a378cd9c3a022500d7feaefb4e3bb43fdd789131 Mon Sep 17 00:00:00 2001 +From: Khem Raj <[email protected]> +Date: Sun, 7 Mar 2021 17:30:24 -0800 +Subject: [PATCH] hwclock: Check for SYS_settimeofday before calling syscall + +Some newer architectures e.g. RISCV32 have 64bit time_t from get go and +thusly do not have gettimeofday_time64/settimeofday_time64 implemented +therefore check for SYS_settimeofday definition before making the +syscall. Fixes build for riscv32 and it will bail out at runtime. + +Upstream-Status: Submitted [http://lists.busybox.net/pipermail/busybox/2021-March/088583.html] +Signed-off-by: Khem Raj <[email protected]> +Upstream: http://lists.busybox.net/pipermail/busybox/2021-March/088583.html +[Thomas: this issue has been discussed on the musl mailing list, and +the musl developers' opinion is that Busybox is wrong: +https://www.openwall.com/lists/musl/2024/03/03/2 +https://www.openwall.com/lists/musl/2024/04/07/2. The correct fix +isn't clear, and in the mean time, the patch from Khem turns the build +issue into a runtime error only on the problematic architecture, which +seems like a reasonable trade-off] +Signed-off-by: Thomas Petazzoni <[email protected]> +--- + util-linux/hwclock.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/util-linux/hwclock.c b/util-linux/hwclock.c +index 723b09589..b9faaabbc 100644 +--- a/util-linux/hwclock.c ++++ b/util-linux/hwclock.c +@@ -131,6 +131,7 @@ static void show_clock(const char **pp_rtcname, int utc) + + static void set_kernel_tz(const struct timezone *tz) + { ++ int ret = 1; + #if LIBC_IS_MUSL + /* musl libc does not pass tz argument to syscall + * because "it's deprecated by POSIX, therefore it's fine +@@ -139,9 +140,11 @@ static void set_kernel_tz(const struct timezone *tz) + #if !defined(SYS_settimeofday) && defined(SYS_settimeofday_time32) + # define SYS_settimeofday SYS_settimeofday_time32 + #endif +- int ret = syscall(SYS_settimeofday, NULL, tz); ++#if defined(SYS_settimeofday) ++ ret = syscall(SYS_settimeofday, NULL, tz); ++#endif + #else +- int ret = settimeofday(NULL, tz); ++ ret = settimeofday(NULL, tz); + #endif + if (ret) + bb_simple_perror_msg_and_die("settimeofday"); +-- +2.48.1 +
Signature · 6 lines
2.48.1 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Re: [Buildroot] [PATCH 3/4] package/busybox: fix hwclock build issue on RISC-V 32-bit musl configs
Quoted 15 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Thomas" == Thomas Petazzoni via buildroot <[email protected]> writes:
Take a patch from meta-riscv, which was submitted upstream by Khem Raj to fix a build issue on RISC-V 32-bit musl configurations. This issue has been discussed with musl developers who believe this is a Busybox issue. The patch from Khem works around the issue by making it a runtime failure just affecting hwclock on RISC-V 32-bit musl instead of a build failure. The correct fix is not really clear, as there seems to be a disagreement between Busybox people and musl people on what the C library
settimeofday()function should do, and that's why Busybox is bypassingsettimeofday()on musl by making a direct system call, except this system call doesn't exist on RISC-V 32-bit.In the mean time, this patch fixes the long standing Gitlab CI issue:
Quoted 7 lines
- tests.toolchain.test_external_bootlin.TestExternalToolchainBootlinRiscv32ilp32dMuslStable
https://gitlab.com/buildroot.org/buildroot/-/jobs/8954291684- tests.toolchain.test_external_bootlin.TestExternalToolchainBootlinRiscv32ilp32dMuslBleedingEdge
https://gitlab.com/buildroot.org/buildroot/-/jobs/8954291683Signed-off-by Thomas Petazzoni <[email protected]>
Seems messy, but OK - Committed, thanks.
Signature · 5 lines
Bye, Peter Korsgaard _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Re: [Buildroot] [PATCH 3/4] package/busybox: fix hwclock build issue on RISC-V 32-bit musl configs
In reply to Thomas Petazzoni via buildrootQuoted 15 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Thomas" == Thomas Petazzoni via buildroot <[email protected]> writes:
Take a patch from meta-riscv, which was submitted upstream by Khem Raj to fix a build issue on RISC-V 32-bit musl configurations. This issue has been discussed with musl developers who believe this is a Busybox issue. The patch from Khem works around the issue by making it a runtime failure just affecting hwclock on RISC-V 32-bit musl instead of a build failure. The correct fix is not really clear, as there seems to be a disagreement between Busybox people and musl people on what the C library
settimeofday()function should do, and that's why Busybox is bypassingsettimeofday()on musl by making a direct system call, except this system call doesn't exist on RISC-V 32-bit.In the mean time, this patch fixes the long standing Gitlab CI issue:
Quoted 7 lines
- tests.toolchain.test_external_bootlin.TestExternalToolchainBootlinRiscv32ilp32dMuslStable
https://gitlab.com/buildroot.org/buildroot/-/jobs/8954291684- tests.toolchain.test_external_bootlin.TestExternalToolchainBootlinRiscv32ilp32dMuslBleedingEdge
https://gitlab.com/buildroot.org/buildroot/-/jobs/8954291683Signed-off-by Thomas Petazzoni <[email protected]>
Committed to 2024.02.x and 2024.11.x, thanks.
Signature · 5 lines
Bye, Peter Korsgaard _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH 4/4 package/busybox bump version to 1.37.0
In reply to Thomas Petazzoni via buildrootFrom: Clement Ramirez <[email protected]>
Patch 0005-seedrng-fix-for-glibc-2.24-not-providing-getrandom.patch is dropped as it is upstream as of
https://git.busybox.net/busybox/commit/?id=200a9669fbf6f06894e4243cccc9fc11a1a6073a
Patch 0006-seedrng-fix-for-glibc-2.24-not-providing-random-head.patch is dropped as it is upstream as of
https://git.busybox.net/busybox/commit/?id=cb57abb46f06f4ede8d9ccbdaac67377fdf416cf
Patch 0008-shell-fix-SIGWINCH-and-SIGCHLD-in-hush-interrupting-.patch is dropped as it is upstream as of
https://git.busybox.net/busybox/commit/?id=93e0898c663a533082b5f3c2e7dcce93ec47076d
Patch 0011-awk-fix-use-after-realloc-CVE-2021-42380-closes-1560.patch is dropped as it is upstream as of
https://git.busybox.net/busybox/commit/?id=5dcc443dba039b305a510c01883e9f34e42656ae
Patch 0012-awk-fix-use-after-free-CVE-2023-42363.patch is dropped as it is upstream as of
https://git.busybox.net/busybox/commit/?id=fb08d43d44d1fea1f741fafb9aa7e1958a5f69aa
Patch 0013-awk-fix-precedence-of-relative-to.patch is dropped as it is upstream as of
https://git.busybox.net/busybox/commit/?id=0256e00a9d077588bd3a39f5a1ef7e2eaa2911e4
Patch 0014-awk-fix-ternary-operator-and-precedence-of.patch is dropped as it is upstream as of
https://git.busybox.net/busybox/commit/?id=38335df9e9f45378c3407defd38b5b610578bdda
Remaining patches are renumbered/refreshed.
Patch 0010-libbb-sha-add-missing-sha-NI-guard.patch is added, taken from the mailing list, to fix a build issue.
Patch 0011-syslogd-fix-wrong-OPT_locallog-flag-detection.patch, taken from the mailing list, is added to fix a runtime issue with syslogd which was pointed out by Bernd Kulhs.
[Thomas: update with more patches being dropped, renumber patches, backport some patches needed to fix known build and runtime issues]
---
...route-use-linux-if_packet.h-instead-.patch | 10 +-
...trip-non-l-arguments-returned-by-pkg.patch | 15 +-
...tr-ensure-only-printable-characters-.patch | 4 +-
...e-all-printed-strings-with-printable.patch | 16 +-
...r-glibc-2.24-not-providing-getrandom.patch | 39 ----
...random-detection-for-non-glibc-libc.patch} | 30 +--
...failing-saying-ncurses-is-not-found.patch} | 4 +-
...glibc-2.24-not-providing-random-head.patch | 60 ------
...Fix-compilation-with-Linux-v6.8-rc1.patch} | 4 +-
...-awk.c-fix-CVE-2023-42366-bug-15874.patch} | 8 +-
...CH-and-SIGCHLD-in-hush-interrupting-.patch | 103 ---------
...-SYS_settimeofday-before-calling-sy.patch} | 8 +-
...0-libbb-sha-add-missing-sha-NI-guard.patch | 54 +++++
...r-realloc-CVE-2021-42380-closes-1560.patch | 154 -------------
...ix-wrong-OPT_locallog-flag-detection.patch | 37 ++++
...wk-fix-use-after-free-CVE-2023-42363.patch | 70 ------
...13-awk-fix-precedence-of-relative-to.patch | 203 ------------------
...x-ternary-operator-and-precedence-of.patch | 102 ---------
package/busybox/busybox.hash | 4 +-
package/busybox/busybox.mk | 2 +-
20 files changed, 134 insertions(+), 793 deletions(-)
delete mode 100644 package/busybox/0005-seedrng-fix-for-glibc-2.24-not-providing-getrandom.patch
rename package/busybox/{0007-seedrng-fix-getrandom-detection-for-non-glibc-libc.patch => 0005-seedrng-fix-getrandom-detection-for-non-glibc-libc.patch} (81%)
rename package/busybox/{0009-menuconfig-gcc-failing-saying-ncurses-is-not-found.patch => 0006-menuconfig-GCC-failing-saying-ncurses-is-not-found.patch} (94%)
delete mode 100644 package/busybox/0006-seedrng-fix-for-glibc-2.24-not-providing-random-head.patch
rename package/busybox/{0010-Linux-v6.8-rc1-removed-the-definitions-related-to-CB.patch => 0007-tc-Fix-compilation-with-Linux-v6.8-rc1.patch} (96%)
rename package/busybox/{0015-awk.c-fix-CVE-2023-42366-bug-15874.patch => 0008-awk.c-fix-CVE-2023-42366-bug-15874.patch} (88%)
delete mode 100644 package/busybox/0008-shell-fix-SIGWINCH-and-SIGCHLD-in-hush-interrupting-.patch
rename package/busybox/{0016-hwclock-Check-for-SYS_settimeofday-before-calling-sy.patch => 0009-hwclock-Check-for-SYS_settimeofday-before-calling-sy.patch} (89%)
create mode 100644 package/busybox/0010-libbb-sha-add-missing-sha-NI-guard.patch
delete mode 100644 package/busybox/0011-awk-fix-use-after-realloc-CVE-2021-42380-closes-1560.patch
create mode 100644 package/busybox/0011-syslogd-fix-wrong-OPT_locallog-flag-detection.patch
delete mode 100644 package/busybox/0012-awk-fix-use-after-free-CVE-2023-42363.patch
delete mode 100644 package/busybox/0013-awk-fix-precedence-of-relative-to.patch
delete mode 100644 package/busybox/0014-awk-fix-ternary-operator-and-precedence-of.patchpackage/busybox/0001-networking-libiproute-use-linux-if_packet.h-instead-.patch +5 -5
@@ -1,4 +1,4 @@ -From 60da1d0763224698008d847eb8ad8d4d8c6f54ff Mon Sep 17 00:00:00 2001 +From e1690453cd84c798ca88cc4370710f65da86d986 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni <[email protected]> Date: Sat, 5 Oct 2013 15:55:06 +0200 Subject: [PATCH] networking/libiproute: use <linux/if_packet.h> instead of
@@ -20,7 +20,7 @@ Signed-off-by: Petr Vorel <[email protected]> 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/networking/libiproute/iplink.c b/networking/libiproute/iplink.c -index 1a1064bdc..a4c3ad307 100644 +index 37ed114bc..bc526d89c 100644 --- a/networking/libiproute/iplink.c +++ b/networking/libiproute/iplink.c @@ -7,7 +7,7 @@
@@ -30,8 +30,8 @@ index 1a1064bdc..a4c3ad307 100644 -#include <netpacket/packet.h> +#include <linux/if_packet.h> #include <netinet/if_ether.h> - + #include <linux/if_vlan.h> --- -2.33.0 +-- +2.48.1
package/busybox/0002-Makefile.flags-strip-non-l-arguments-returned-by-pkg.patch +7 -8
@@ -1,8 +1,7 @@ -From 59daea82e7b5abcdb42a4f97a0109f14d5a774ea Mon Sep 17 00:00:00 2001 +From df20ae1280a2601a4c233ec12372d1e17db21e96 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni <[email protected]> Date: Mon, 25 Nov 2013 22:51:53 +0100 -Subject: [PATCH] Makefile.flags: strip non -l arguments returned by - pkg-config +Subject: [PATCH] Makefile.flags: strip non -l arguments returned by pkg-config Signed-off-by: Thomas Petazzoni <[email protected]> [[email protected]: refresh for 1.29.0]
@@ -14,10 +13,10 @@ Signed-off-by: Petr Vorel <[email protected]> 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile.flags b/Makefile.flags -index 667481983..88d76efec 100644 +index 97cb4dca2..92a9063d9 100644 --- a/Makefile.flags +++ b/Makefile.flags -@@ -180,7 +180,9 @@ ifeq ($(CONFIG_SELINUX),y) +@@ -181,7 +181,9 @@ ifeq ($(CONFIG_SELINUX),y) SELINUX_PC_MODULES = libselinux libsepol $(eval $(call pkg_check_modules,SELINUX,$(SELINUX_PC_MODULES))) CPPFLAGS += $(SELINUX_CFLAGS)
@@ -26,8 +25,8 @@ index 667481983..88d76efec 100644 + $(patsubst -l%,%,$(filter -l%,$(SELINUX_LIBS))),\ + $(SELINUX_PC_MODULES:lib%=%)) endif - + ifeq ($(CONFIG_FEATURE_NSLOOKUP_BIG),y) --- -2.33.0 +-- +2.48.1
package/busybox/0003-libbb-sockaddr2str-ensure-only-printable-characters-.patch +2 -2
@@ -1,4 +1,4 @@ -From 9d825e854ef53ebbe0aea2f1a69f52b763104daf Mon Sep 17 00:00:00 2001 +From 68eaf20d86d4fe0f16a914817217f386155157cc Mon Sep 17 00:00:00 2001 From: Ariadne Conill <[email protected]> Date: Mon, 19 Sep 2022 14:15:12 +0200 Subject: [PATCH] libbb: sockaddr2str: ensure only printable characters are
@@ -38,5 +38,5 @@ index 0e0b247b8..02c061e67 100644 } -- -2.37.3 +2.48.1
package/busybox/0004-nslookup-sanitize-all-printed-strings-with-printable.patch +8 -8
@@ -1,4 +1,4 @@ -From bd463a5564a2c0618317448c3f965d389534c3df Mon Sep 17 00:00:00 2001 +From 56b84c6efb9a06ae294eb92cf9634f70af443b0a Mon Sep 17 00:00:00 2001 From: Ariadne Conill <[email protected]> Date: Mon, 19 Sep 2022 14:15:12 +0200 Subject: [PATCH] nslookup: sanitize all printed strings with printable_string
@@ -16,10 +16,10 @@ Signed-off-by: Quentin Schulz <[email protected]> 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/networking/nslookup.c b/networking/nslookup.c -index 6da97baf4..4bdcde1b8 100644 +index b67d354f7..79412477c 100644 --- a/networking/nslookup.c +++ b/networking/nslookup.c -@@ -407,7 +407,7 @@ static NOINLINE int parse_reply(const unsigned char *msg, size_t len) +@@ -784,7 +784,7 @@ static NOINLINE int parse_reply(const unsigned char *msg, size_t len) //printf("Unable to uncompress domain: %s\n", strerror(errno)); return -1; }
@@ -28,7 +28,7 @@ index 6da97baf4..4bdcde1b8 100644 break; case ns_t_mx: -@@ -422,7 +422,7 @@ static NOINLINE int parse_reply(const unsigned char *msg, size_t len) +@@ -799,7 +799,7 @@ static NOINLINE int parse_reply(const unsigned char *msg, size_t len) //printf("Cannot uncompress MX domain: %s\n", strerror(errno)); return -1; }
@@ -37,7 +37,7 @@ index 6da97baf4..4bdcde1b8 100644 break; case ns_t_txt: -@@ -434,7 +434,7 @@ static NOINLINE int parse_reply(const unsigned char *msg, size_t len) +@@ -811,7 +811,7 @@ static NOINLINE int parse_reply(const unsigned char *msg, size_t len) if (n > 0) { memset(dname, 0, sizeof(dname)); memcpy(dname, ns_rr_rdata(rr) + 1, n);
@@ -46,7 +46,7 @@ index 6da97baf4..4bdcde1b8 100644 } break; -@@ -454,7 +454,7 @@ static NOINLINE int parse_reply(const unsigned char *msg, size_t len) +@@ -831,7 +831,7 @@ static NOINLINE int parse_reply(const unsigned char *msg, size_t len) } printf("%s\tservice = %u %u %u %s\n", ns_rr_name(rr),
@@ -55,7 +55,7 @@ index 6da97baf4..4bdcde1b8 100644 break; case ns_t_soa: -@@ -483,7 +483,7 @@ static NOINLINE int parse_reply(const unsigned char *msg, size_t len) +@@ -860,7 +860,7 @@ static NOINLINE int parse_reply(const unsigned char *msg, size_t len) return -1; }
@@ -65,5 +65,5 @@ index 6da97baf4..4bdcde1b8 100644 printf("\tserial = %lu\n", ns_get32(cp)); -- -2.37.3 +2.48.1
package/busybox/0005-seedrng-fix-for-glibc-2.24-not-providing-getrandom.patch deleted +0 -39
@@ -1,39 +0,0 @@ -From 200a9669fbf6f06894e4243cccc9fc11a1a6073a Mon Sep 17 00:00:00 2001 -From: Denys Vlasenko <[email protected]> -Date: Mon, 10 Apr 2023 17:26:04 +0200 -Subject: [PATCH] seedrng: fix for glibc <= 2.24 not providing getrandom() - -Signed-off-by: Denys Vlasenko <[email protected]> -Upstream: https://git.busybox.net/busybox/commit/?id=200a9669fbf6f06894e4243cccc9fc11a1a6073a ---- - miscutils/seedrng.c | 14 ++++++++++++++ - 1 file changed, 14 insertions(+) - -diff --git a/miscutils/seedrng.c b/miscutils/seedrng.c -index 967741dc7..7cc855141 100644 ---- a/miscutils/seedrng.c -+++ b/miscutils/seedrng.c -@@ -45,6 +45,20 @@ - #include <sys/random.h> - #include <sys/file.h> - -+/* Fix up glibc <= 2.24 not having getrandom() */ -+#if defined(__GLIBC__) && __GLIBC__ == 2 && __GLIBC_MINOR__ <= 24 -+#include <sys/syscall.h> -+# define getrandom(...) bb_getrandom(__VA_ARGS__) -+static ssize_t getrandom(void *buffer, size_t length, unsigned flags) -+{ -+# if defined(__NR_getrandom) -+ return syscall(__NR_getrandom, buffer, length, flags); -+# else -+ return ENOSYS; -+# endif -+} -+#endif -+ - #ifndef GRND_INSECURE - #define GRND_INSECURE 0x0004 /* Apparently some headers don't ship with this yet. */ - #endif --- -2.39.1 -
package/busybox/0005-seedrng-fix-getrandom-detection-for-non-glibc-libc.patch renamed from package/busybox/0007-seedrng-fix-getrandom-detection-for-non-glibc-libc.patch +6 -24
@@ -1,7 +1,7 @@ -From b2d26d449ec855602b9a88f58c2eb675de0224f2 Mon Sep 17 00:00:00 2001 +From 9fed109be1f811069cb2f727e04c6996cd44b017 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20M=C3=A9lotte?= <[email protected]> Date: Tue, 18 Apr 2023 15:54:43 +0200 -Subject: [PATCH v4] seedrng: fix getrandom() detection for non-glibc libc +Subject: [PATCH] seedrng: fix getrandom() detection for non-glibc libc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit
@@ -48,33 +48,15 @@ This should fix compiling with many libc/kernel combinations. Signed-off-by: Raphaël Mélotte <[email protected]> Upstream: http://lists.busybox.net/pipermail/busybox/2023-May/090317.html --- -Changes v3 -> v4: - - use a variable for '#' for compatibility with GNU make 4.2.1 and earlier. - -Changes v2 -> v3: - - fix _GNU_SOURCE define location - -Changes v1 -> v2: - - move _GNU_SOURCE to bb_libtest.c - - remove GRND_NONBLOCK - -Note that I was not able to test every single combination, but I could -confirm it builds successfully for: -uClibc 10.0.24, linux headers 3.10 (libc getrandom NOT used) -uClibc 1.0.36, linux headers 4.9 (libc getrandom used) -musl 1.1.16, linux headers 4.12 (libc getrandom NOT used) -musl 1.2.1, linux headers (libc getrandom used) -glibc 2.25, linux headers 4.10 (libc getrandom used) - Makefile.flags | 12 ++++++++++++ miscutils/seedrng.c | 8 ++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/Makefile.flags b/Makefile.flags -index 1cec5ba20..0d437303a 100644 +index 92a9063d9..c8f601308 100644 --- a/Makefile.flags +++ b/Makefile.flags -@@ -161,6 +161,18 @@ ifeq ($(RT_AVAILABLE),y) +@@ -162,6 +162,18 @@ ifeq ($(RT_AVAILABLE),y) LDLIBS += rt endif
@@ -94,7 +76,7 @@ index 1cec5ba20..0d437303a 100644 # On some platforms that requires an explicit -lpthread, -ldl, -laudit. # However, on *other platforms* it fails when some of those flags diff --git a/miscutils/seedrng.c b/miscutils/seedrng.c -index 3bf6e2ea7..2f1e18c32 100644 +index 7a2331cb1..ba98f4d19 100644 --- a/miscutils/seedrng.c +++ b/miscutils/seedrng.c @@ -44,8 +44,10 @@
@@ -120,5 +102,5 @@ index 3bf6e2ea7..2f1e18c32 100644 /* Apparently some headers don't ship with this yet. */ -- -2.39.1 +2.48.1
package/busybox/0006-menuconfig-GCC-failing-saying-ncurses-is-not-found.patch renamed from package/busybox/0009-menuconfig-gcc-failing-saying-ncurses-is-not-found.patch +2 -2
@@ -1,4 +1,4 @@ -From 32949508fe566aee8988cb6d8ee101ecc5e49a65 Mon Sep 17 00:00:00 2001 +From 7f0bb7f69f38298971aa8153d3fbe9b1fdda8ae7 Mon Sep 17 00:00:00 2001 From: ctxnop <[email protected]> Date: Sun, 26 Jan 2025 20:59:20 +0100 Subject: [PATCH] menuconfig: GCC failing saying ncurses is not found
@@ -34,5 +34,5 @@ index 5075ebf2d..08e4da3de 100755 if [ $? != 0 ]; then echo " *** Unable to find the ncurses libraries or the" 1>&2 -- -2.47.1 +2.48.1
package/busybox/0006-seedrng-fix-for-glibc-2.24-not-providing-random-head.patch deleted +0 -60
60 lines not on this page · raw message
package/busybox/0007-tc-Fix-compilation-with-Linux-v6.8-rc1.patch renamed from package/busybox/0010-Linux-v6.8-rc1-removed-the-definitions-related-to-CB.patch +2 -2
@@ -1,4 +1,4 @@ -From c4f93565acf3718111cdbaea15e1a8aacf2f44cf Mon Sep 17 00:00:00 2001 +From 1dbb3073a3a8856b9446b882f797be1bb2e21a26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= <[email protected]> Date: Mon, 23 Sep 2024 18:56:00 +0200 Subject: [PATCH] tc: Fix compilation with Linux v6.8-rc1
@@ -66,5 +66,5 @@ index 3a79fd2d9..d08fd1359 100644 /* don't know how to print options for this class */ printf("(options for %s)", name); -- -2.39.5 +2.48.1
package/busybox/0008-awk.c-fix-CVE-2023-42366-bug-15874.patch renamed from package/busybox/0015-awk.c-fix-CVE-2023-42366-bug-15874.patch +4 -4
@@ -1,4 +1,4 @@ -From 54e64812090f58cffca08fcf11d2dbc471c964e1 Mon Sep 17 00:00:00 2001 +From 88f8a046f27cb81ccc30d038465e963b8300cf1b Mon Sep 17 00:00:00 2001 From: Valery Ushakov <[email protected]> Date: Wed, 24 Jan 2024 22:24:41 +0300 Subject: [PATCH] awk.c: fix CVE-2023-42366 (bug #15874)
@@ -21,10 +21,10 @@ Signed-off-by: Thomas Petazzoni <[email protected]> 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/editors/awk.c b/editors/awk.c -index 9467f4644..947195333 100644 +index 64e752f4b..222e6298d 100644 --- a/editors/awk.c +++ b/editors/awk.c -@@ -1168,9 +1168,11 @@ static uint32_t next_token(uint32_t expected) +@@ -1234,9 +1234,11 @@ static uint32_t next_token(uint32_t expected) s[-1] = bb_process_escape_sequence((const char **)&pp); if (*p == '\\') *s++ = '\\';
@@ -39,5 +39,5 @@ index 9467f4644..947195333 100644 } } -- -2.47.1 +2.48.1
package/busybox/0008-shell-fix-SIGWINCH-and-SIGCHLD-in-hush-interrupting-.patch deleted +0 -103
103 lines not on this page · raw message
package/busybox/0009-hwclock-Check-for-SYS_settimeofday-before-calling-sy.patch renamed from package/busybox/0016-hwclock-Check-for-SYS_settimeofday-before-calling-sy.patch +4 -4
@@ -1,4 +1,4 @@ -From a378cd9c3a022500d7feaefb4e3bb43fdd789131 Mon Sep 17 00:00:00 2001 +From 0583f8eda94f97e15e371e12458877b738439e8c Mon Sep 17 00:00:00 2001 From: Khem Raj <[email protected]> Date: Sun, 7 Mar 2021 17:30:24 -0800 Subject: [PATCH] hwclock: Check for SYS_settimeofday before calling syscall
@@ -24,10 +24,10 @@ Signed-off-by: Thomas Petazzoni <[email protected]> 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/util-linux/hwclock.c b/util-linux/hwclock.c -index 723b09589..b9faaabbc 100644 +index c3fd0eb57..dea9c9a55 100644 --- a/util-linux/hwclock.c +++ b/util-linux/hwclock.c -@@ -131,6 +131,7 @@ static void show_clock(const char **pp_rtcname, int utc) +@@ -132,6 +132,7 @@ static void show_clock(const char **pp_rtcname, int utc) static void set_kernel_tz(const struct timezone *tz) {
@@ -35,7 +35,7 @@ index 723b09589..b9faaabbc 100644 #if LIBC_IS_MUSL /* musl libc does not pass tz argument to syscall * because "it's deprecated by POSIX, therefore it's fine -@@ -139,9 +140,11 @@ static void set_kernel_tz(const struct timezone *tz) +@@ -140,9 +141,11 @@ static void set_kernel_tz(const struct timezone *tz) #if !defined(SYS_settimeofday) && defined(SYS_settimeofday_time32) # define SYS_settimeofday SYS_settimeofday_time32 #endif
package/busybox/0010-libbb-sha-add-missing-sha-NI-guard.patch new file +54 -0
54 lines not on this page · raw message
package/busybox/0011-awk-fix-use-after-realloc-CVE-2021-42380-closes-1560.patch deleted +0 -154
154 lines not on this page · raw message
package/busybox/0011-syslogd-fix-wrong-OPT_locallog-flag-detection.patch new file +37 -0
@@ -0,0 +1,37 @@ +From 34d331d642c3312e1c04e4650f547f1a67abee24 Mon Sep 17 00:00:00 2001 +From: Andrej Valek <[email protected]> +Date: Wed, 16 Oct 2024 10:15:08 +0200 +Subject: [PATCH] syslogd: fix wrong OPT_locallog flag detection + +The OPT_locallog was set on "option_mask32" but checked on local +"opts" variable. While this flag it's used on multiple places can't be +has to be used with "option_mask32". Without this change syslogd +is more-less unusable while no messages are logged locally. + +Signed-off-by: Andrej Valek <[email protected]> +Upstream: https://lists.busybox.net/pipermail/busybox/2024-October/090969.html +[Thomas: this was reported as beeing needed by Bernd Kuhls at +https://lore.kernel.org/buildroot/pan$de0bb$35c5a64$ca9b6f21$2408ff40@ID-313208.user.individual.net/, +but also on the Busybox mailing list at +https://lists.busybox.net/pipermail/busybox/2023-September/090499.html] +Signed-off-by: Thomas Petazzoni <[email protected]> +--- + sysklogd/syslogd.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/sysklogd/syslogd.c b/sysklogd/syslogd.c +index 7558051f0..fa03aa280 100644 +--- a/sysklogd/syslogd.c ++++ b/sysklogd/syslogd.c +@@ -1179,7 +1179,7 @@ int syslogd_main(int argc UNUSED_PARAM, char **argv) + } + } + #endif +- if (!ENABLE_FEATURE_REMOTE_LOG || (opts & OPT_locallog)) { ++ if (!ENABLE_FEATURE_REMOTE_LOG || (option_mask32 & OPT_locallog)) { + recvbuf[sz] = '\0'; /* ensure it *is* NUL terminated */ + split_escape_and_log(recvbuf, sz); + } +-- +2.48.1 +
package/busybox/0012-awk-fix-use-after-free-CVE-2023-42363.patch deleted +0 -70
70 lines not on this page · raw message
package/busybox/0013-awk-fix-precedence-of-relative-to.patch deleted +0 -203
203 lines not on this page · raw message
package/busybox/0014-awk-fix-ternary-operator-and-precedence-of.patch deleted +0 -102
102 lines not on this page · raw message
package/busybox/busybox.hash +2 -2
@@ -1,5 +1,5 @@ -# From https://busybox.net/downloads/busybox-1.36.1.tar.bz2.sha256 -sha256 b8cc24c9574d809e7279c3be349795c5d5ceb6fdf19ca709f80cde50e47de314 busybox-1.36.1.tar.bz2 +# From https://busybox.net/downloads/busybox-1.37.0.tar.bz2.sha256 +sha256 3311dff32e746499f4df0d5df04d7eb396382d7e108bb9250e7b519b837043a4 busybox-1.37.0.tar.bz2 # Locally computed sha256 bbfc9843646d483c334664f651c208b9839626891d8f17604db2146962f43548 LICENSE sha256 b5a136ed67798e51fe2e0ca0b2a21cb01b904ff0c9f7d563a6292e276607e58f archival/libarchive/bz/LICENSE
package/busybox/busybox.mk +1 -1
@@ -4,7 +4,7 @@ # ################################################################################ -BUSYBOX_VERSION = 1.36.1 +BUSYBOX_VERSION = 1.37.0 BUSYBOX_SITE = https://www.busybox.net/downloads BUSYBOX_SOURCE = busybox-$(BUSYBOX_VERSION).tar.bz2 BUSYBOX_LICENSE = GPL-2.0, bzip2-1.0.4
Signature · 6 lines
2.48.1 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Re: [Buildroot] [PATCH 4/4] package/busybox bump version to 1.37.0
Quoted 36 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Thomas" == Thomas Petazzoni via buildroot <[email protected]> writes:
From: Clement Ramirez <[email protected]>
Patch 0005-seedrng-fix-for-glibc-2.24-not-providing-getrandom.patch is dropped as it is upstream as of
https://git.busybox.net/busybox/commit/?id=200a9669fbf6f06894e4243cccc9fc11a1a6073aPatch 0006-seedrng-fix-for-glibc-2.24-not-providing-random-head.patch is dropped as it is upstream as of
https://git.busybox.net/busybox/commit/?id=cb57abb46f06f4ede8d9ccbdaac67377fdf416cfPatch 0008-shell-fix-SIGWINCH-and-SIGCHLD-in-hush-interrupting-.patch is dropped as it is upstream as of
https://git.busybox.net/busybox/commit/?id=93e0898c663a533082b5f3c2e7dcce93ec47076dPatch 0011-awk-fix-use-after-realloc-CVE-2021-42380-closes-1560.patch is dropped as it is upstream as of
https://git.busybox.net/busybox/commit/?id=5dcc443dba039b305a510c01883e9f34e42656aePatch 0012-awk-fix-use-after-free-CVE-2023-42363.patch is dropped as it is upstream as of
https://git.busybox.net/busybox/commit/?id=fb08d43d44d1fea1f741fafb9aa7e1958a5f69aaPatch 0013-awk-fix-precedence-of-relative-to.patch is dropped as it is upstream as of
https://git.busybox.net/busybox/commit/?id=0256e00a9d077588bd3a39f5a1ef7e2eaa2911e4Patch 0014-awk-fix-ternary-operator-and-precedence-of.patch is dropped as it is upstream as of
https://git.busybox.net/busybox/commit/?id=38335df9e9f45378c3407defd38b5b610578bddaRemaining patches are renumbered/refreshed.
Patch 0010-libbb-sha-add-missing-sha-NI-guard.patch is added, taken from the mailing list, to fix a build issue.
Quoted 8 lines
Patch 0011-syslogd-fix-wrong-OPT_locallog-flag-detection.patch, taken from the mailing list, is added to fix a runtime issue with syslogd which was pointed out by Bernd Kulhs.
Signed-off-by Clement Ramirez <[email protected]>[Thomas: update with more patches being dropped, renumber patches, backport some patches needed to fix known build and runtime issues]
Signed-off-by Thomas Petazzoni <[email protected]>
Committed, thanks.
Signature · 5 lines
Bye, Peter Korsgaard _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot