From 5f2025ad88e46e4cfae65f7e6987d57e28e6afde Mon Sep 17 00:00:00 2001 From: penny Date: Fri, 14 Feb 2025 10:10:58 +0800 Subject: [PATCH] adds experimental logging and time functionality for `zcip`and disables CBQ support --- busybox-1.31.1-stime-fix.patch | 24 +++++++++++++++++ busybox-1.36.1-no-cbq.patch | 49 ++++++++++++++++++++++++++++++++++ busybox.spec | 17 +++++++++++- 3 files changed, 89 insertions(+), 1 deletion(-) create mode 100644 busybox-1.31.1-stime-fix.patch create mode 100644 busybox-1.36.1-no-cbq.patch diff --git a/busybox-1.31.1-stime-fix.patch b/busybox-1.31.1-stime-fix.patch new file mode 100644 index 0000000..388e63f --- /dev/null +++ b/busybox-1.31.1-stime-fix.patch @@ -0,0 +1,24 @@ +diff -up busybox-1.31.1/libbb/Kbuild.src.stime busybox-1.31.1/libbb/Kbuild.src +--- busybox-1.31.1/libbb/Kbuild.src.stime 2019-11-13 17:08:22.808371597 -0500 ++++ busybox-1.31.1/libbb/Kbuild.src 2019-11-13 17:08:50.154882529 -0500 +@@ -198,3 +198,6 @@ lib-$(CONFIG_FEATURE_FIND_REGEX) += xreg + + # Add the experimental logging functionality, only used by zcip + lib-$(CONFIG_ZCIP) += logenv.o ++ ++lib-$(CONFIG_DATE) += stime.o ++lib-$(CONFIG_RDATE) += stime.o +diff -up busybox-1.31.1/libbb/stime.c.stime busybox-1.31.1/libbb/stime.c +--- busybox-1.31.1/libbb/stime.c.stime 2019-11-13 17:07:06.905723262 -0500 ++++ busybox-1.31.1/libbb/stime.c 2019-11-13 17:07:51.769924328 -0500 +@@ -0,0 +1,10 @@ ++#include ++#include ++ ++int stime(const time_t *t) { ++ struct timeval tv; ++ ++ tv.tv_sec = *t; ++ tv.tv_usec = 0; ++ return settimeofday(&tv, NULL); ++} diff --git a/busybox-1.36.1-no-cbq.patch b/busybox-1.36.1-no-cbq.patch new file mode 100644 index 0000000..a0b06e8 --- /dev/null +++ b/busybox-1.36.1-no-cbq.patch @@ -0,0 +1,49 @@ +diff -up busybox-1.36.1/networking/tc.c.no-cbq busybox-1.36.1/networking/tc.c +--- busybox-1.36.1/networking/tc.c.no-cbq 2024-01-29 10:24:09.135082923 -0500 ++++ busybox-1.36.1/networking/tc.c 2024-01-29 10:28:12.009502552 -0500 +@@ -31,7 +31,7 @@ + //usage: "qdisc [handle QHANDLE] [root|"IF_FEATURE_TC_INGRESS("ingress|")"parent CLASSID]\n" + /* //usage: "[estimator INTERVAL TIME_CONSTANT]\n" */ + //usage: " [[QDISC_KIND] [help|OPTIONS]]\n" +-//usage: " QDISC_KIND := [p|b]fifo|tbf|prio|cbq|red|etc.\n" ++//usage: " QDISC_KIND := [p|b]fifo|tbf|prio|red|etc.\n" + //usage: "qdisc show [dev STRING]"IF_FEATURE_TC_INGRESS(" [ingress]")"\n" + //usage: "class [classid CLASSID] [root|parent CLASSID]\n" + //usage: " [[QDISC_KIND] [help|OPTIONS] ]\n" +@@ -230,7 +230,7 @@ static int cbq_parse_opt(int argc, char + { + return 0; + } +-#endif ++ + static int cbq_print_opt(struct rtattr *opt) + { + struct rtattr *tb[TCA_CBQ_MAX+1]; +@@ -322,6 +322,7 @@ static int cbq_print_opt(struct rtattr * + done: + return 0; + } ++#endif + + static FAST_FUNC int print_qdisc( + const struct sockaddr_nl *who UNUSED_PARAM, +@@ -373,7 +374,8 @@ static FAST_FUNC int print_qdisc( + if (qqq == 0) { /* pfifo_fast aka prio */ + prio_print_opt(tb[TCA_OPTIONS]); + } else if (qqq == 1) { /* class based queuing */ +- cbq_print_opt(tb[TCA_OPTIONS]); ++ /* cbq_print_opt(tb[TCA_OPTIONS]); */ ++ printf("cbq not supported"); + } else { + /* don't know how to print options for this qdisc */ + printf("(options for %s)", name); +@@ -444,7 +446,8 @@ static FAST_FUNC int print_class( + /* nothing. */ /*prio_print_opt(tb[TCA_OPTIONS]);*/ + } else if (qqq == 1) { /* class based queuing */ + /* cbq_print_copt() is identical to cbq_print_opt(). */ +- cbq_print_opt(tb[TCA_OPTIONS]); ++ /* cbq_print_opt(tb[TCA_OPTIONS]); */ ++ printf("cbq not supported"); + } else { + /* don't know how to print options for this class */ + printf("(options for %s)", name); diff --git a/busybox.spec b/busybox.spec index aa34f54..4156c48 100644 --- a/busybox.spec +++ b/busybox.spec @@ -4,7 +4,7 @@ %endif %if "%{!?RELEASE:1}" -%define RELEASE 8 +%define RELEASE 9 %endif Epoch: 1 @@ -19,6 +19,15 @@ Source: http://www.busybox.net/downloads/%{name}-%{version}.tar.bz2 Source1: busybox-static.config Source2: busybox-petitboot.config Source3: busybox-dynamic.config +Patch0: busybox-1.31.1-stime-fix.patch +# Linux no longer supports CBQ UAPI as of +# https://github.com/torvalds/linux/commit/33241dca486264193ed68167c8eeae1fb197f3df +# I just changed networking/tc.c to print an unsupported message if you try to set options for cbq +# ... there is probably a better fix. +# Technically, the bundled headers from sabotage-linux still have the CBQ vars, but they're really old at this point. +# Felt safer to just disable CBQ, as that is what iproute did: +# https://github.com/iproute2/iproute2/commit/07ba0af3fee132eddc1c2eab643ff4910181c993 +Patch1: busybox-1.36.1-no-cbq.patch Patch6000: backport-CVE-2022-28391.patch Patch6001: backport-CVE-2022-48174.patch @@ -100,6 +109,12 @@ install -m 644 docs/busybox.dynamic.1 $RPM_BUILD_ROOT/%{_mandir}/man1/busybox.1 %{_mandir}/man1/busybox.petitboot.1.gz %changelog +* Fri Feb 14 2025 pengjian - 1:1.36.1-9 +- Type:enhancement +- Id:NA +- SUG:NA +- DESC:adds experimental logging and time functionality for `zcip`and disables CBQ support + * Fri Nov 15 2024 liuxu - 1:1.36.1-8 - Type:CVE - Id:NA -- Gitee