From 8dbe73b482ba786c1347bcf171b98f1432d4d759cdb959185136442b2b6a1d67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Tue, 25 Feb 2025 18:59:10 +0100 Subject: [PATCH] Sync from SUSE:SLFO:Main busybox revision b4934a9e98776cfa11ae0460ff36a9c1 --- ash-fix-segfault-d417193cf.patch | 80 ------------------ busybox-1.36.1.tar.bz2 | 3 - busybox-1.36.1.tar.bz2.sig | Bin 95 -> 0 bytes ...ional-for-sha1_process_block64_shaNI.patch | 13 +++ busybox-1.37.0.tar.bz2 | 3 + busybox-1.37.0.tar.bz2.sig | Bin 0 -> 121 bytes busybox.changes | 25 ++++++ busybox.config | 9 +- busybox.spec | 56 ++++++------ tc-no-TCA_CBQ.patch | 18 ++++ 10 files changed, 93 insertions(+), 114 deletions(-) delete mode 100644 ash-fix-segfault-d417193cf.patch delete mode 100644 busybox-1.36.1.tar.bz2 delete mode 100644 busybox-1.36.1.tar.bz2.sig create mode 100644 busybox-1.37.0-fix-conditional-for-sha1_process_block64_shaNI.patch create mode 100644 busybox-1.37.0.tar.bz2 create mode 100644 busybox-1.37.0.tar.bz2.sig create mode 100644 tc-no-TCA_CBQ.patch diff --git a/ash-fix-segfault-d417193cf.patch b/ash-fix-segfault-d417193cf.patch deleted file mode 100644 index 12b566d..0000000 --- a/ash-fix-segfault-d417193cf.patch +++ /dev/null @@ -1,80 +0,0 @@ -From d417193cf37ca1005830d7e16f5fa7e1d8a44209 Mon Sep 17 00:00:00 2001 -From: Denys Vlasenko -Date: Mon, 12 Jun 2023 17:48:47 +0200 -Subject: [PATCH] shell: avoid segfault on ${0::0/0~09J}. Closes 15216 - -function old new delta -evaluate_string 1011 1053 +42 - -Signed-off-by: Denys Vlasenko ---- - shell/math.c | 39 +++++++++++++++++++++++++++++++++++---- - 1 file changed, 35 insertions(+), 4 deletions(-) - -diff --git a/shell/math.c b/shell/math.c -index 76d22c9bd..727c29467 100644 ---- a/shell/math.c -+++ b/shell/math.c -@@ -577,6 +577,28 @@ static arith_t strto_arith_t(const char *nptr, char **endptr) - # endif - #endif - -+//TODO: much better estimation than expr_len/2? Such as: -+//static unsigned estimate_nums_and_names(const char *expr) -+//{ -+// unsigned count = 0; -+// while (*(expr = skip_whitespace(expr)) != '\0') { -+// const char *p; -+// if (isdigit(*expr)) { -+// while (isdigit(*++expr)) -+// continue; -+// count++; -+// continue; -+// } -+// p = endofname(expr); -+// if (p != expr) { -+// expr = p; -+// count++; -+// continue; -+// } -+// } -+// return count; -+//} -+ - static arith_t - evaluate_string(arith_state_t *math_state, const char *expr) - { -@@ -584,10 +606,12 @@ evaluate_string(arith_state_t *math_state, const char *expr) - const char *errmsg; - const char *start_expr = expr = skip_whitespace(expr); - unsigned expr_len = strlen(expr) + 2; -- /* Stack of integers */ -- /* The proof that there can be no more than strlen(startbuf)/2+1 -- * integers in any given correct or incorrect expression -- * is left as an exercise to the reader. */ -+ /* Stack of integers/names */ -+ /* There can be no more than strlen(startbuf)/2+1 -+ * integers/names in any given correct or incorrect expression. -+ * (modulo "09v09v09v09v09v" case, -+ * but we have code to detect that early) -+ */ - var_or_num_t *const numstack = alloca((expr_len / 2) * sizeof(numstack[0])); - var_or_num_t *numstackptr = numstack; - /* Stack of operator tokens */ -@@ -652,6 +676,13 @@ evaluate_string(arith_state_t *math_state, const char *expr) - numstackptr->var = NULL; - errno = 0; - numstackptr->val = strto_arith_t(expr, (char**) &expr); -+ /* A number can't be followed by another number, or a variable name. -+ * We'd catch this later anyway, but this would require numstack[] -+ * to be twice as deep to handle strings where _every_ char is -+ * a new number or name. Example: 09v09v09v09v09v09v09v09v09v -+ */ -+ if (isalnum(*expr) || *expr == '_') -+ goto err; - //bb_error_msg("val:%lld", numstackptr->val); - if (errno) - numstackptr->val = 0; /* bash compat */ --- -2.26.2 - diff --git a/busybox-1.36.1.tar.bz2 b/busybox-1.36.1.tar.bz2 deleted file mode 100644 index 77a0ec1..0000000 --- a/busybox-1.36.1.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b8cc24c9574d809e7279c3be349795c5d5ceb6fdf19ca709f80cde50e47de314 -size 2525473 diff --git a/busybox-1.36.1.tar.bz2.sig b/busybox-1.36.1.tar.bz2.sig deleted file mode 100644 index fc23fee9e6aab58630e073ebd5778f62964ec0bc9192e101640ed24c3c59ed34..0000000000000000000000000000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 95 zcmeB(WnmCxVvrS6WI6fLF~97Y!0iijS@_+z^MtNBIW3x%DJ5process_block == sha1_process_block64 + #if ENABLE_SHA1_HWACCEL ++# if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) + || ctx->process_block == sha1_process_block64_shaNI ++# endif + #endif + ) { + hash_size = 5; diff --git a/busybox-1.37.0.tar.bz2 b/busybox-1.37.0.tar.bz2 new file mode 100644 index 0000000..c4d2092 --- /dev/null +++ b/busybox-1.37.0.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3311dff32e746499f4df0d5df04d7eb396382d7e108bb9250e7b519b837043a4 +size 2565764 diff --git a/busybox-1.37.0.tar.bz2.sig b/busybox-1.37.0.tar.bz2.sig new file mode 100644 index 0000000000000000000000000000000000000000000000000000000000000000..8a0bcc449475344505886274825986bbf4fa670f40d65bf6e30e3c0fbed6aab9 GIT binary patch literal 121 zcmeAuXJHUzVlWp|WI6fLF~97Y!0iijS@_+z^MtNBIW3x%Dedc}Ly|IODT#VHnR%rZ z4(a*%={c#niJ3Wi$@#eqT$}_&dD)O*e*Cfn WUq5V#U9-z_vtS3CTX{wp??wPdW;1U9 literal 0 HcmV?d00001 diff --git a/busybox.changes b/busybox.changes index 1f8e8a1..145af6b 100644 --- a/busybox.changes +++ b/busybox.changes @@ -1,3 +1,28 @@ +------------------------------------------------------------------- +Mon Oct 7 07:59:23 UTC 2024 - Guillaume GARDET + +- Add patch to fix build on non-x86* architectures: + * busybox-1.37.0-fix-conditional-for-sha1_process_block64_shaNI.patch + +------------------------------------------------------------------- +Fri Oct 4 11:55:30 UTC 2024 - Thorsten Kukuk + +- Fix busybox.config again (got broken with 1.37.0 update) +- Cleanup spec file + +------------------------------------------------------------------- +Sat Sep 28 20:48:01 UTC 2024 - Matthias G. Eckermann + +- Update to 1.37.0 +- remove unnecessary patch ash-fix-segfault-d417193cf.patch +- Update default config to match 1.37.0 expectations + +------------------------------------------------------------------- +Thu Mar 14 09:15:13 UTC 2024 - Thorsten Kukuk + +- tc-no-TCA_CBQ.patch: Disable TCA_CBQ code if kernel headers don't + support them. + ------------------------------------------------------------------- Fri Dec 8 10:47:35 UTC 2023 - Thorsten Kukuk diff --git a/busybox.config b/busybox.config index fcd5c98..dceb7c5 100644 --- a/busybox.config +++ b/busybox.config @@ -1,7 +1,6 @@ # # Automatically generated make config: don't edit -# Busybox version: 1.37.0.git -# Fri Jan 6 09:43:46 2023 +# Busybox version: 1.37.0 # CONFIG_HAVE_DOT_CONFIG=y @@ -17,6 +16,7 @@ CONFIG_SHOW_USAGE=y CONFIG_FEATURE_VERBOSE_USAGE=y CONFIG_FEATURE_COMPRESS_USAGE=y CONFIG_LFS=y +CONFIG_TIME64=y # CONFIG_PAM is not set CONFIG_FEATURE_DEVPTS=y CONFIG_FEATURE_UTMP=y @@ -469,6 +469,7 @@ CONFIG_FEATURE_FIND_INUM=y CONFIG_FEATURE_FIND_SAMEFILE=y CONFIG_FEATURE_FIND_EXEC=y CONFIG_FEATURE_FIND_EXEC_PLUS=y +CONFIG_FEATURE_FIND_EXEC_OK=y CONFIG_FEATURE_FIND_USER=y CONFIG_FEATURE_FIND_GROUP=y CONFIG_FEATURE_FIND_NOT=y @@ -795,6 +796,7 @@ CONFIG_FEATURE_CROND_DIR="" # CONFIG_FLASH_LOCK is not set # CONFIG_FLASH_UNLOCK is not set # CONFIG_FLASHCP is not set +CONFIG_GETFATTR=y # CONFIG_HDPARM is not set # CONFIG_FEATURE_HDPARM_GET_IDENTITY is not set # CONFIG_FEATURE_HDPARM_HDIO_SCAN_HWIF is not set @@ -933,6 +935,7 @@ CONFIG_IPRULE=y CONFIG_IPNEIGH=y CONFIG_FEATURE_IP_ADDRESS=y CONFIG_FEATURE_IP_LINK=y +CONFIG_FEATURE_IP_LINK_CAN=y CONFIG_FEATURE_IP_ROUTE=y CONFIG_FEATURE_IP_ROUTE_DIR="/etc/iproute2" CONFIG_FEATURE_IP_TUNNEL=y @@ -1007,6 +1010,7 @@ CONFIG_FEATURE_WGET_OPENSSL=y CONFIG_WHOIS=y CONFIG_ZCIP=y # CONFIG_UDHCPD is not set +# CONFIG_FEATURE_UDHCPD_BOOTP is not set # CONFIG_FEATURE_UDHCPD_BASE_IP_ON_MAC is not set # CONFIG_FEATURE_UDHCPD_WRITE_LEASES_EARLY is not set CONFIG_DHCPD_LEASES_FILE="" @@ -1155,7 +1159,6 @@ CONFIG_ASH_MAIL=y CONFIG_ASH_ECHO=y CONFIG_ASH_PRINTF=y CONFIG_ASH_TEST=y -CONFIG_ASH_SLEEP=y CONFIG_ASH_HELP=y CONFIG_ASH_GETOPTS=y CONFIG_ASH_CMDCMD=y diff --git a/busybox.spec b/busybox.spec index 9946721..1440430 100644 --- a/busybox.spec +++ b/busybox.spec @@ -1,7 +1,7 @@ # # spec file for package busybox # -# Copyright (c) 2023 SUSE LLC +# Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -24,11 +24,10 @@ %bcond_without static Name: busybox -Version: 1.36.1 +Version: 1.37.0 Release: 0 Summary: Minimalist variant of UNIX utilities linked in a single executable License: GPL-2.0-or-later -Group: System/Base URL: https://www.busybox.net/ Source: https://busybox.net/downloads/%{name}-%{version}.tar.bz2 Source2: busybox.config @@ -42,22 +41,26 @@ Source7: busybox.config.static.warewulf3 Patch0: cpio-long-opt.patch Patch1: sendmail-ignore-F-option.patch Patch2: testsuite-gnu-echo.patch -# PATCH-FIX-UPSTREAM shell: avoid segfault on ${0::0/0~09J} (CVE-2022-48174) https://git.busybox.net/busybox/commit/?id=d417193cf -Patch3: ash-fix-segfault-d417193cf.patch +# # PATCH-FIX-UPSTREAM shell: avoid segfault on ${0::0/0~09J} (CVE-2022-48174) https://git.busybox.net/busybox/commit/?id=d417193cf +# Patch3: ash-fix-segfault-d417193cf.patch Patch4: udhcp6-install-path.patch +Patch5: tc-no-TCA_CBQ.patch +# PATCH-FIX-UPSTREAM - Borrowed from Fedora - https://src.fedoraproject.org/rpms/busybox/blob/rawhide/f/busybox-1.37.0-fix-conditional-for-sha1_process_block64_shaNI.patch +Patch6: busybox-1.37.0-fix-conditional-for-sha1_process_block64_shaNI.patch # other patches Patch100: busybox.install.patch -Provides: useradd_or_adduser_dep BuildRequires: glibc-devel-static +BuildRequires: pkgconfig +BuildRequires: pkgconfig(libselinux) +# for test suite +BuildRequires: zip +Provides: useradd_or_adduser_dep #in SLE12 hostname is part of the net-tools package %if %{?suse_version} && %{?suse_version} <= 1315 BuildRequires: net-tools %else BuildRequires: hostname %endif -BuildRequires: pkgconfig(libselinux) -# for test suite -BuildRequires: zip %description BusyBox combines tiny versions of many common UNIX utilities into a @@ -74,7 +77,6 @@ box but need special configuration, like udhcpc, the dhcp client. %package static Summary: Static linked version of Busybox, a compact UNIX utility collection -Group: System/Base %description static BusyBox combines tiny versions of many common UNIX utilities into a @@ -82,7 +84,6 @@ single executable. %package warewulf3 Summary: Static version of Busybox - for building Warewulf3 -Group: System/Base %description warewulf3 This version of busybox is only for building Warewulf3 @@ -90,7 +91,6 @@ https://github.com/warewulf/warewulf3 %package testsuite Summary: Testsuite of busybox -Group: Development/Testing Requires: %{name} = %{version} Requires: zip @@ -99,8 +99,8 @@ Using this package you can test the busybox build on different kernels and glibc It needs to run with permission to the current directory, so either copy it away as is or run as root: -cd /usr/share/busybox/testsuite -PATH=/usr/share/busybox:$PATH SKIP_KNOWN_BUGS=1 ./runtest +cd %{_datadir}/busybox/testsuite +PATH=%{_datadir}/busybox:$PATH SKIP_KNOWN_BUGS=1 ./runtest %prep #SLE12 needs an empty line after autosetup for it to expand properly (bsc#1205420) @@ -117,31 +117,31 @@ export CC="gcc" export HOSTCC=gcc %if %{with static} cat %{SOURCE3} %{SOURCE2} > .config -make %{?_smp_mflags} -e oldconfig -make -e %{?_smp_mflags} +%make_build -e oldconfig +%make_build -e mv busybox busybox-static %endif %if 0%{with ww3} -make -e %{?_smp_mflags} clean +%make_build -e clean cat %{SOURCE7} %{SOURCE3} %{SOURCE2} > .config -make %{?_smp_mflags} -e oldconfig -make -e %{?_smp_mflags} +%make_build -e oldconfig +%make_build -e mv busybox busybox-warewulf3 -make -e busybox.links %{?_smp_mflags} +%make_build -e busybox.links mv busybox.links busybox-warewulf3.links %endif -make -e %{?_smp_mflags} clean +%make_build -e clean cp -a %{SOURCE2} .config -make %{?_smp_mflags} -e oldconfig +%make_build -e oldconfig #make -e %{?_smp_mflags} -make -e -make -e doc busybox.links %{?_smp_mflags} +%make_build -e +%make_build -e doc busybox.links %if 0%{?suse_version} >= 1550 for i in busybox.links %{?with_ww3:busybox-warewulf3.links}; do - sed -i -e 's,^/\(s\?bin\)/,/usr/\1/,' $i + sed -i -e 's,^/\(s\?bin\)/,%{_prefix}/\1/,' $i done %endif @@ -163,7 +163,7 @@ install -m 0644 busybox-warewulf3.links %{buildroot}%{_datadir}/busybox install -m 0755 busybox-warewulf3 %{buildroot}%{_bindir} %endif cp %{SOURCE2} %{buildroot}%{_datadir}/busybox/.config -ln -s %_bindir/busybox %{buildroot}%{_datadir}/busybox/busybox +ln -s %{_bindir}/busybox %{buildroot}%{_datadir}/busybox/busybox cp -a testsuite %{buildroot}%{_datadir}/busybox/testsuite %check @@ -174,13 +174,13 @@ export CC="gcc" export HOSTCC=gcc export SKIP_KNOWN_BUGS=1 export SKIP_INTERNET_TESTS=1 -make -e %{?_smp_mflags} test +%make_build -e test %files %license LICENSE %doc docs/mdev.txt %config %{_sysconfdir}/man.conf -%doc %{_mandir}/man1/busybox.1.gz +%{_mandir}/man1/busybox.1%{?ext_man} %{_bindir}/busybox %{_bindir}/busybox.install %dir %{_datadir}/busybox diff --git a/tc-no-TCA_CBQ.patch b/tc-no-TCA_CBQ.patch new file mode 100644 index 0000000..c2a8fc9 --- /dev/null +++ b/tc-no-TCA_CBQ.patch @@ -0,0 +1,18 @@ +--- busybox-1.36.1/networking/tc.c.old 2023-01-03 15:14:43.000000000 +0100 ++++ busybox-1.36.1/networking/tc.c 2024-03-14 10:04:19.733155657 +0100 +@@ -233,6 +233,7 @@ + #endif + static int cbq_print_opt(struct rtattr *opt) + { ++#ifdef TCA_CBQ_MAX + struct rtattr *tb[TCA_CBQ_MAX+1]; + struct tc_ratespec *r = NULL; + struct tc_cbq_lssopt *lss = NULL; +@@ -320,6 +321,7 @@ + } + } + done: ++#endif + return 0; + } +