From Qi.Chen at windriver.com Wed May 7 07:57:56 2025 From: Qi.Chen at windriver.com (ChenQi) Date: Wed, 7 May 2025 15:57:56 +0800 Subject: [EXTERNAL] [RESEND(4) PATCH] archival: disallow path traversals (CVE-2023-39810) In-Reply-To: <9DA0B81B-ADE8-4F36-ABF3-8E0D47973137@entrust.com> References: <20241002081205.2803537-1-peter.kaestle@nokia.com> <8510DCEB-E23E-452A-9616-61892984DD1B@entrust.com> <4f424141-c511-456f-93ef-9da1a4968eb1@windriver.com> <9DA0B81B-ADE8-4F36-ABF3-8E0D47973137@entrust.com> Message-ID: Kindly ping Is this an appropriate fix or do we need another solution? Regards, Qi On 3/31/25 17:39, Ian Norton wrote: > > I do not know. I never had any feedback from the maintainers.? #16018 > is I think just as much of a problem as CVE-2023-39810. > > In tar, you _/are/_ allowed to traverse outside the cwd (and use > absolute paths) But because #16018 can be used to mask the output from > `tar -t` it allows an attacker to defeat almost all manual or > shell-scripted inspection of the archive that would allow a user to > catch and prevent these traversals. > > *From: *busybox on behalf of ChenQi > > *Date: *Monday 31 March 2025 at 10:28 > *To: *"busybox at busybox.net" > *Subject: *Re: [EXTERNAL] [RESEND(4) PATCH] archival: disallow path > traversals (CVE-2023-39810) > > Will this patch be accepted? Or is it not suitable for busybox for > some reason? Regards, Qi On 10/11/24 15:?54, Ian Norton wrote: FYI, > This seems also related to > https:?//bugs.?busybox.?net/show_bug.?cgi?id=16018 (my patch for > fixing that seems to > > Will this patch be accepted? Or is it not suitable for busybox for > some reason? > > Regards, > > Qi > > On 10/11/24 15:54, Ian Norton wrote: > > FYI, This seems also related to > https://bugs.busybox.net/show_bug.cgi?id=16018 > ? > (my patch for fixing that seems to have got lost in the mailing > list noise) > > *From: *busybox > on behalf of Peter Kaestle > > *Date: *Wednesday 2 October 2024 at 09:12 > *To: *"busybox at busybox.net" > , Denys Vlasenko > > *Cc: *"martin.schobert at pentagrid.ch" > > > , Peter Kaestle > , Samuel > Sapalski > > *Subject: *[EXTERNAL] [RESEND(4) PATCH] archival: disallow path > traversals (CVE-2023-39810) > > Create new configure option for archival/libarchive based > extractions to disallow path traversals. As this is a paranoid > option and might introduce backward incompatibiltiy, default it to > no. Fixes: CVE-2023-39810 Signed-off-by: Peter Kaestle > > Create new configure option for archival/libarchive based > extractions to > > disallow path traversals. > > As this is a paranoid option and might introduce backward > > incompatibiltiy, default it to no. > > Fixes: CVE-2023-39810 > > Signed-off-by: Peter Kaestle > > > Reviewed-by: Samuel Sapalski > > > --- > > archival/Config.src??????????????????? |? 7 +++++++ > > archival/libarchive/data_extract_all.c | 22 ++++++++++++++++++++++ > > testsuite/cpio.tests?????????????????? | 18 ++++++++++++++++++ > > 3 files changed, 47 insertions(+) > > diff --git a/archival/Config.src b/archival/Config.src > > index 6f4f30c43..ac9d3db95 100644 > > --- a/archival/Config.src > > +++ b/archival/Config.src > > @@ -35,4 +35,11 @@ config FEATURE_LZMA_FAST > > ????????????? This option reduces decompression time by about 25% > at the cost of > > ????????????? a 1K bigger binary. > > +config FEATURE_PATH_TRAVERSAL_PROTECTION > > +???????????? bool "enable path traversal protection" > > +???????????? default n > > +???????????? help > > +???????????? This option will disallow extraction of files > outside of the > > +???????????? destination directory. > > + > > endmenu > > diff --git a/archival/libarchive/data_extract_all.c > b/archival/libarchive/data_extract_all.c > > index 049c2c156..cb5d5c4ca 100644 > > --- a/archival/libarchive/data_extract_all.c > > +++ b/archival/libarchive/data_extract_all.c > > @@ -66,6 +66,28 @@ void FAST_FUNC > data_extract_all(archive_handle_t *archive_handle) > > ????????????? } > > #endif > > +#if ENABLE_FEATURE_PATH_TRAVERSAL_PROTECTION > > +???????????? if (strstr(dst_name, "../")) { > > +??????????????????????????? char *resolved_dst_path, *cwd; > > + > > +??????????????????????????? cwd = getcwd(NULL, 0); > > + > > +??????????????????????????? resolved_dst_path = > xmalloc_realpath_coreutils(dst_name); > > +??????????????????????????? if (resolved_dst_path) { > > +??????????????????????????????????????????? if (strncmp(cwd, > resolved_dst_path, strlen(cwd))) { > > +?????????????????????????????????????????????????????????? errno > = 0; /* suppress missleading error prints */ > > +?????????????????????????????????????????????????????????? > free(resolved_dst_path); > > +?????????????????????????????????????????????????????????? > bb_perror_msg_and_die("path traversal detected: %s", > > +???????????????????????????????????????????????????????????????????????????????????????? > dst_name); > > +??????????????????????????????????????????? } > > +??????????????????????????????????????????? free(resolved_dst_path); > > +??????????????????????????? } else { > > +??????????????????????????????????????????? > bb_perror_msg_and_die("cannot allocate memory for real path: %s", > > +????????????????????????????????????????????????????????????????????????? > dst_name); > > +??????????????????????????? } > > +???????????? } > > +#endif > > + > > ????????????? if (archive_handle->ah_flags & > ARCHIVE_CREATE_LEADING_DIRS) { > > ????????????????????????????? char *slash = strrchr(dst_name, '/'); > > ????????????????????????????? if (slash) { > > diff --git a/testsuite/cpio.tests b/testsuite/cpio.tests > > index 85e746589..1c0b75297 100755 > > --- a/testsuite/cpio.tests > > +++ b/testsuite/cpio.tests > > @@ -154,6 +154,24 @@ testing "cpio -R with extract" \ > > " "" "" > > SKIP= > > +optional FEATURE_PATH_TRAVERSAL_PROTECTION > > +rm -rf cpio.testdir > > +mkdir -p cpio.testdir/prepare/inner > > +echo "file outside of destination was written" > > cpio.testdir/prepare/dont_write > > +echo "data" > cpio.testdir/prepare/inner/to_extract > > +mkdir -p cpio.testdir/extract > > +testing "cpio extract file outside of destination" \ > > +"(cd cpio.testdir/prepare/inner && echo -e > '../dont_write\nto_extract' | cpio -H newc --create) | > > +(cd cpio.testdir/extract && cpio -vi 2>&1); > > +echo \$?; > > +ls cpio.testdir/dont_write 2>&1" \ > > +"\ > > +cpio: path traversal detected: ../dont_write > > +1 > > +ls: cpio.testdir/dont_write: No such file or directory > > +" "" "" > > +SKIP= > > + > > # Clean up > > rm -rf cpio.testdir cpio.testdir2 2>/dev/null > > -- > > 2.42.0 > > _______________________________________________ > > busybox mailing list > > busybox at busybox.net > > https://urldefense.com/v3/__http://lists.busybox.net/mailman/listinfo/busybox__;!!FJ-Y8qCqXTj2!dv3Uoeo_xECehdxW2TOtpmp-ONDwsssh0Tl72I5vnwfii2WIcR71lUIMVSJb44L4bKG4Eg6HpK5s3-Bv4ph0xWY$ > > > /Any email and files/attachments transmitted with it are intended > solely for the use of the individual or entity to whom they are > addressed. If this message has been sent to you in error, you must > not copy, distribute or disclose of the information it contains. > _Please notify Entrust immediately and delete the message from > your system._/ > > *Wellbeing Notice:* Receiving this email outside of normal working > hours? Managing work and life responsibilities is unique for > everyone. I have sent this email at a time that works for me. > Unless this email is specifically marked urgent, please respond at > a time that works for you. > > _______________________________________________ > > busybox mailing list > > busybox at busybox.net > > http://lists.busybox.net/mailman/listinfo/busybox > -------------- next part -------------- An HTML attachment was scrubbed... URL: From xoneca at gmail.com Tue May 13 09:33:28 2025 From: xoneca at gmail.com (Xabier Oneca -- xOneca) Date: Tue, 13 May 2025 11:33:28 +0200 Subject: [EXTERNAL] [RESEND(4) PATCH] archival: disallow path traversals (CVE-2023-39810) In-Reply-To: References: <20241002081205.2803537-1-peter.kaestle@nokia.com> <8510DCEB-E23E-452A-9616-61892984DD1B@entrust.com> <4f424141-c511-456f-93ef-9da1a4968eb1@windriver.com> <9DA0B81B-ADE8-4F36-ABF3-8E0D47973137@entrust.com> Message-ID: Hi Qi, FWIW, as he said in his response (https://lists.busybox.net/pipermail/busybox/2025-April/091436.html), Denys already commited something similar (https://git.busybox.net/busybox/commit/?id=9a8796436b9b0641e13480811902ea2ac57881d3). Cheers, Xabier Oneca_,,_ From jan at faulty.computer Thu May 15 08:11:39 2025 From: jan at faulty.computer (Jan Fooken) Date: Thu, 15 May 2025 08:11:39 +0000 (UTC) Subject: [PATCH] df: allow 1024 byte blocks when POSIXLY_CORRECT Message-ID: <20250515074835.23127-2-jan@faulty.computer> Hi, while parsing the output of df I realised that the behaviour is a bit different compared to the behaviour described by POSIX, especially when it comes to handling the options -k and -P. The current and previous revisions of the POSIX standard POSIX.1-2017 and POSIX.1-2024 both allow for using 1024 byte based blocks, when the option -k is passed. This patch implements this functionality even when POSIXLY_CORRECT is set. Furthermore, it aligns the behaviour of the with the current df variant from GNU coreutils as of version 9.7. Regarding the -P behaviour: The POSIX spec states to use 512 byte blocks when it's passed and the current busybox version uses 1024 byte blocks except when POSIXLY_CORRECT is set. I think it would be a good idea to follow POSIX.1 a bit more closely and use 512 byte blocks when -P is passed and 1024 byte blocks when -Pk is passed regardless of the state of POSIXLY_CORRECT. What do you think? Kind regards Jan Fooken --- coreutils/df.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/coreutils/df.c b/coreutils/df.c index 03aa78148..015994efb 100644 --- a/coreutils/df.c +++ b/coreutils/df.c @@ -155,6 +155,9 @@ int df_main(int argc UNUSED_PARAM, char **argv) , &opt_t IF_FEATURE_DF_FANCY(, &chp) ); + if (opt & OPT_KILO) + df_disp_hr = 1024; + if (opt & OPT_MEGA) df_disp_hr = 1024*1024; -- 2.49.0 From aknowles at galleonec.com Thu May 22 10:01:30 2025 From: aknowles at galleonec.com (Andrew Knowles) Date: Thu, 22 May 2025 10:01:30 +0000 Subject: [PATCH] Add sha384sum applet Message-ID: This patch adds a sha384sum applet. Most of the implementation is shared with the existing sha512sum applet. I was not able to get reliable applet size information from make_single_applets.sh and size_single_applets.sh so I left the reported applet size the same as sha512sum. Signed-off-by: Andy Knowles aknowles at galleonec.com -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-Add-sha384sum-applet.patch Type: application/octet-stream Size: 10500 bytes Desc: 0001-Add-sha384sum-applet.patch URL: From radoslav.kolev at suse.com Thu May 22 14:59:51 2025 From: radoslav.kolev at suse.com (Radoslav Kolev) Date: Thu, 22 May 2025 17:59:51 +0300 Subject: [PATCH 0/1] ping: Implement setting of hoplimit for IPv6, remove hack Message-ID: <20250522145952.268204-1-radoslav.kolev@suse.com> Setting the hoplimit (TTL) value for IPv6 was not implemented and the help text commented out. A hack redefining IPV6_HOPLIMIT was removed and replaced by using the new IPV6_RECVHOPLIMIT option to request receiving the hoplimit instead. Since RFC 3542 was introduced more that 20 years ago hopefully all OS/libc implementations have caugh up with this until now, but in case a problem with the above is found I can implement a fallback to the old values. Radoslav Kolev (1): ping: Fix hop limit (TTL) handling for IPv6 networking/ping.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) -- 2.49.0 From radoslav.kolev at suse.com Thu May 22 14:59:52 2025 From: radoslav.kolev at suse.com (Radoslav Kolev) Date: Thu, 22 May 2025 17:59:52 +0300 Subject: [PATCH 1/1] ping: Fix hop limit (TTL) handling for IPv6 In-Reply-To: <20250522145952.268204-1-radoslav.kolev@suse.com> References: <20250522145952.268204-1-radoslav.kolev@suse.com> Message-ID: <20250522145952.268204-2-radoslav.kolev@suse.com> Setting the hop limit was not implemented for IPv6. Also there was a hack to override IPV6_HOPLIMIT to the value of IPV6_2292HOPLIMIT, which was only introduced for backwards compatibility when RFC 3542 superseded RFC 2292. The proper way is to use IPV6_RECVHOPLIMIT in the setsockopt call when requesting the value and IPV6_HOPLIMIT only when retrieving it. Signed-off-by: Radoslav Kolev --- networking/ping.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/networking/ping.c b/networking/ping.c index b7e6955a9..4e1979d5a 100644 --- a/networking/ping.c +++ b/networking/ping.c @@ -92,8 +92,7 @@ //usage: "\n -s SIZE Send SIZE data bytes in packets (default 56)" //usage: "\n -i SECS Interval" //usage: "\n -A Ping as soon as reply is received" -///////: "\n -t TTL Set TTL" -///////^^^^^ -t not tested for IPv6, might be not working +//usage: "\n -t TTL Set TTL" //usage: "\n -I IFACE/IP Source interface or IP address" //usage: "\n -W SEC Seconds to wait for the first response (default 10)" //usage: "\n (after all -c CNT packets are sent)" @@ -156,12 +155,6 @@ #if ENABLE_PING6 # include -/* I see RENUMBERED constants in bits/in.h - !!? - * What a fuck is going on with libc? Is it a glibc joke? */ -# ifdef IPV6_2292HOPLIMIT -# undef IPV6_HOPLIMIT -# define IPV6_HOPLIMIT IPV6_2292HOPLIMIT -# endif #endif #if defined(__FreeBSD__) @@ -844,6 +837,12 @@ static void ping6(len_and_sockaddr *lsa) /* enable broadcast pings */ setsockopt_broadcast(pingsock); + if (opt_ttl != 0) { + setsockopt_int(pingsock, IPPROTO_IPV6, IPV6_UNICAST_HOPS, opt_ttl); + /* above doesn't affect packets sent to bcast IP, so... */ + setsockopt_int(pingsock, IPPROTO_IPV6, IPV6_MULTICAST_HOPS, opt_ttl); + } + /* set recv buf (needed if we can get lots of responses: flood ping, * broadcast ping etc) */ sockopt = (datalen * 2) + 7 * 1024; /* giving it a bit of extra room */ @@ -854,7 +853,7 @@ static void ping6(len_and_sockaddr *lsa) setsockopt_int(pingsock, SOL_RAW, IPV6_CHECKSUM, sockopt); /* request ttl info to be returned in ancillary data */ - setsockopt_1(pingsock, SOL_IPV6, IPV6_HOPLIMIT); + setsockopt_1(pingsock, SOL_IPV6, IPV6_RECVHOPLIMIT); if (if_index) pingaddr.sin6.sin6_scope_id = if_index; -- 2.49.0 From pavankumar14000 at gmail.com Thu May 22 17:07:20 2025 From: pavankumar14000 at gmail.com (Abothula Pavan Kumar) Date: Thu, 22 May 2025 22:37:20 +0530 Subject: networking: compilation error on ubuntu 24 Message-ID: Hi, I'm running into multiple errors while trying to build busybox v1.36.1 on Ubuntu 24.04. CC coreutils/realpath.o networking/tc.c: In function ?cbq_print_opt?: networking/tc.c:236:27: error: ?TCA_CBQ_MAX? undeclared (first use in this function); did you mean ?TCA_CBS_MAX?? 236 | struct rtattr *tb[TCA_CBQ_MAX+1]; | ^~~~~~~~~~~ | TCA_CBS_MAX networking/tc.c:236:27: note: each undeclared identifier is reported only once for each function it appears in miscutils/watchdog.c: In function ?watchdog_main?: CC util-linux/volume_id/ubifs.o miscutils/watchdog.c:161:17: warning: ignoring return value of ?write? declared with attribute ?warn_unused_result? [-Wunused-result] 161 | write(3, "", 1); /* write zero byte */ | ^~~~~~~~~~~~~~~ miscutils/watchdog.c: In function ?shutdown_watchdog?: miscutils/watchdog.c:71:9: warning: ignoring return value of ?write? declared with attribute ?warn_unused_result? [-Wunused-result] 71 | write(3, &V, 1); /* Magic, see watchdog-api.txt in kernel */ | ^~~~~~~~~~~~~~~ CC libbb/get_volsize.o networking/tc.c:249:16: error: ?TCA_CBQ_RATE? undeclared (first use in this function); did you mean ?TCA_TBF_RATE64?? 249 | if (tb[TCA_CBQ_RATE]) { | ^~~~~~~~~~~~ | TCA_TBF_RATE64 CC coreutils/rm.o CC networking/tcpudp_perhost.o CC util-linux/hwclock.o CC util-linux/volume_id/udf.o networking/tc.c:255:16: error: ?TCA_CBQ_LSSOPT? undeclared (first use in this function) 255 | if (tb[TCA_CBQ_LSSOPT]) { | ^~~~~~~~~~~~~~ networking/tc.c:256:61: error: invalid application of ?sizeof? to incomplete type ?struct tc_cbq_lssopt? 256 | if (RTA_PAYLOAD(tb[TCA_CBQ_LSSOPT]) < sizeof(*lss)) | ^ CC util-linux/volume_id/util.o CC libbb/getopt32.o networking/tc.c:261:16: error: ?TCA_CBQ_WRROPT? undeclared (first use in this function) 261 | if (tb[TCA_CBQ_WRROPT]) { | ^~~~~~~~~~~~~~ networking/tc.c:262:61: error: invalid application of ?sizeof? to incomplete type ?struct tc_cbq_wrropt? 262 | if (RTA_PAYLOAD(tb[TCA_CBQ_WRROPT]) < sizeof(*wrr)) | ^ AR miscutils/lib.a networking/tc.c:267:16: error: ?TCA_CBQ_FOPT? undeclared (first use in this function) 267 | if (tb[TCA_CBQ_FOPT]) { | ^~~~~~~~~~~~ CC networking/telnet.o networking/tc.c:268:59: error: invalid application of ?sizeof? to incomplete type ?struct tc_cbq_fopt? 268 | if (RTA_PAYLOAD(tb[TCA_CBQ_FOPT]) < sizeof(*fopt)) | ^ CC util-linux/ionice.o networking/tc.c:273:16: error: ?TCA_CBQ_OVL_STRATEGY? undeclared (first use in this function) 273 | if (tb[TCA_CBQ_OVL_STRATEGY]) { | ^~~~~~~~~~~~~~~~~~~~ CC networking/telnetd.o networking/tc.c:274:67: error: invalid application of ?sizeof? to incomplete type ?struct tc_cbq_ovl? 274 | if (RTA_PAYLOAD(tb[TCA_CBQ_OVL_STRATEGY]) < sizeof(*ovl)) | ^ networking/tc.c:277:50: error: invalid application of ?sizeof? to incomplete type ?struct tc_cbq_ovl? 277 | (unsigned) sizeof(*ovl)); | ^ networking/tc.c:293:23: error: invalid use of undefined type ?struct tc_cbq_lssopt? 293 | if (lss && lss->flags) { | ^~ networking/tc.c:296:24: error: invalid use of undefined type ?struct tc_cbq_lssopt? 296 | if (lss->flags&TCF_CBQ_LSS_BOUNDED) { | ^~ CC util-linux/volume_id/volume_id.o networking/tc.c:296:32: error: ?TCF_CBQ_LSS_BOUNDED? undeclared (first use in this function) 296 | if (lss->flags&TCF_CBQ_LSS_BOUNDED) { | ^~~~~~~~~~~~~~~~~~~ networking/tc.c:300:24: error: invalid use of undefined type ?struct tc_cbq_lssopt? 300 | if (lss->flags&TCF_CBQ_LSS_ISOLATED) { | ^~ CC libbb/getopt_allopts.o networking/tc.c:300:32: error: ?TCF_CBQ_LSS_ISOLATED? undeclared (first use in this function) 300 | if (lss->flags&TCF_CBQ_LSS_ISOLATED) { | ^~~~~~~~~~~~~~~~~~~~ networking/tc.c:308:24: error: invalid use of undefined type ?struct tc_cbq_wrropt? 308 | if (wrr->priority != TC_CBQ_MAXPRIO) | ^~ CC util-linux/ipcrm.o CC util-linux/volume_id/xfs.o CC networking/tftp.o networking/tc.c:308:38: error: ?TC_CBQ_MAXPRIO? undeclared (first use in this function) 308 | if (wrr->priority != TC_CBQ_MAXPRIO) | ^~~~~~~~~~~~~~ networking/tc.c:309:46: error: invalid use of undefined type ?struct tc_cbq_wrropt? 309 | printf("prio %u", wrr->priority); | ^~ networking/tc.c:313:43: error: invalid use of undefined type ?struct tc_cbq_wrropt? 313 | printf("/%u ", wrr->cpriority); | ^~ networking/tc.c:314:32: error: invalid use of undefined type ?struct tc_cbq_wrropt? 314 | if (wrr->weight != 1) { | ^~ networking/tc.c:315:65: error: invalid use of undefined type ?struct tc_cbq_wrropt? 315 | print_rate(buf, sizeof(buf), wrr->weight); | ^~ networking/tc.c:318:32: error: invalid use of undefined type ?struct tc_cbq_wrropt? 318 | if (wrr->allot) | ^~ networking/tc.c:319:57: error: invalid use of undefined type ?struct tc_cbq_wrropt? 319 | printf("allot %ub ", wrr->allot); | ^~ networking/tc.c:236:24: warning: unused variable ?tb? [-Wunused-variable] 236 | struct rtattr *tb[TCA_CBQ_MAX+1]; | ^~ CC coreutils/rmdir.o make[1]: *** [scripts/Makefile.build:197: networking/tc.o] Error 1 make[1]: *** Waiting for unfinished jobs.... not really sure what's missing. any help would be appreciated ! Thank you, Pavan Kumar -------------- next part -------------- An HTML attachment was scrubbed... URL: From yetanothergeek at gmail.com Thu May 22 17:26:00 2025 From: yetanothergeek at gmail.com (Jeff Pohlmeyer) Date: Thu, 22 May 2025 12:26:00 -0500 Subject: networking: compilation error on ubuntu 24 In-Reply-To: References: Message-ID: As a workaround, you can try disabling "tc". (Under networking->tc in menuconfig, or CONFIG_TC in .config). - Jeff On Thu, May 22, 2025 at 12:08?PM Abothula Pavan Kumar wrote: > > Hi, > I'm running into multiple errors while trying to build busybox v1.36.1 on Ubuntu 24.04. > > CC coreutils/realpath.o > networking/tc.c: In function ?cbq_print_opt?: > networking/tc.c:236:27: error: ?TCA_CBQ_MAX? undeclared (first use in this function); did you mean ?TCA_CBS_MAX?? > 236 | struct rtattr *tb[TCA_CBQ_MAX+1]; > | ^~~~~~~~~~~ > | TCA_CBS_MAX > networking/tc.c:236:27: note: each undeclared identifier is reported only once for each function it appears in > miscutils/watchdog.c: In function ?watchdog_main?: > CC util-linux/volume_id/ubifs.o > miscutils/watchdog.c:161:17: warning: ignoring return value of ?write? declared with attribute ?warn_unused_result? [-Wunused-result] > 161 | write(3, "", 1); /* write zero byte */ > | ^~~~~~~~~~~~~~~ > miscutils/watchdog.c: In function ?shutdown_watchdog?: > miscutils/watchdog.c:71:9: warning: ignoring return value of ?write? declared with attribute ?warn_unused_result? [-Wunused-result] > 71 | write(3, &V, 1); /* Magic, see watchdog-api.txt in kernel */ > | ^~~~~~~~~~~~~~~ > CC libbb/get_volsize.o > networking/tc.c:249:16: error: ?TCA_CBQ_RATE? undeclared (first use in this function); did you mean ?TCA_TBF_RATE64?? > 249 | if (tb[TCA_CBQ_RATE]) { > | ^~~~~~~~~~~~ > | TCA_TBF_RATE64 > CC coreutils/rm.o > CC networking/tcpudp_perhost.o > CC util-linux/hwclock.o > CC util-linux/volume_id/udf.o > networking/tc.c:255:16: error: ?TCA_CBQ_LSSOPT? undeclared (first use in this function) > 255 | if (tb[TCA_CBQ_LSSOPT]) { > | ^~~~~~~~~~~~~~ > networking/tc.c:256:61: error: invalid application of ?sizeof? to incomplete type ?struct tc_cbq_lssopt? > 256 | if (RTA_PAYLOAD(tb[TCA_CBQ_LSSOPT]) < sizeof(*lss)) > | ^ > CC util-linux/volume_id/util.o > CC libbb/getopt32.o > networking/tc.c:261:16: error: ?TCA_CBQ_WRROPT? undeclared (first use in this function) > 261 | if (tb[TCA_CBQ_WRROPT]) { > | ^~~~~~~~~~~~~~ > networking/tc.c:262:61: error: invalid application of ?sizeof? to incomplete type ?struct tc_cbq_wrropt? > 262 | if (RTA_PAYLOAD(tb[TCA_CBQ_WRROPT]) < sizeof(*wrr)) > | ^ > AR miscutils/lib.a > networking/tc.c:267:16: error: ?TCA_CBQ_FOPT? undeclared (first use in this function) > 267 | if (tb[TCA_CBQ_FOPT]) { > | ^~~~~~~~~~~~ > CC networking/telnet.o > networking/tc.c:268:59: error: invalid application of ?sizeof? to incomplete type ?struct tc_cbq_fopt? > 268 | if (RTA_PAYLOAD(tb[TCA_CBQ_FOPT]) < sizeof(*fopt)) > | ^ > CC util-linux/ionice.o > networking/tc.c:273:16: error: ?TCA_CBQ_OVL_STRATEGY? undeclared (first use in this function) > 273 | if (tb[TCA_CBQ_OVL_STRATEGY]) { > | ^~~~~~~~~~~~~~~~~~~~ > CC networking/telnetd.o > networking/tc.c:274:67: error: invalid application of ?sizeof? to incomplete type ?struct tc_cbq_ovl? > 274 | if (RTA_PAYLOAD(tb[TCA_CBQ_OVL_STRATEGY]) < sizeof(*ovl)) > | ^ > networking/tc.c:277:50: error: invalid application of ?sizeof? to incomplete type ?struct tc_cbq_ovl? > 277 | (unsigned) sizeof(*ovl)); > | ^ > networking/tc.c:293:23: error: invalid use of undefined type ?struct tc_cbq_lssopt? > 293 | if (lss && lss->flags) { > | ^~ > networking/tc.c:296:24: error: invalid use of undefined type ?struct tc_cbq_lssopt? > 296 | if (lss->flags&TCF_CBQ_LSS_BOUNDED) { > | ^~ > CC util-linux/volume_id/volume_id.o > networking/tc.c:296:32: error: ?TCF_CBQ_LSS_BOUNDED? undeclared (first use in this function) > 296 | if (lss->flags&TCF_CBQ_LSS_BOUNDED) { > | ^~~~~~~~~~~~~~~~~~~ > networking/tc.c:300:24: error: invalid use of undefined type ?struct tc_cbq_lssopt? > 300 | if (lss->flags&TCF_CBQ_LSS_ISOLATED) { > | ^~ > CC libbb/getopt_allopts.o > networking/tc.c:300:32: error: ?TCF_CBQ_LSS_ISOLATED? undeclared (first use in this function) > 300 | if (lss->flags&TCF_CBQ_LSS_ISOLATED) { > | ^~~~~~~~~~~~~~~~~~~~ > networking/tc.c:308:24: error: invalid use of undefined type ?struct tc_cbq_wrropt? > 308 | if (wrr->priority != TC_CBQ_MAXPRIO) > | ^~ > CC util-linux/ipcrm.o > CC util-linux/volume_id/xfs.o > CC networking/tftp.o > networking/tc.c:308:38: error: ?TC_CBQ_MAXPRIO? undeclared (first use in this function) > 308 | if (wrr->priority != TC_CBQ_MAXPRIO) > | ^~~~~~~~~~~~~~ > networking/tc.c:309:46: error: invalid use of undefined type ?struct tc_cbq_wrropt? > 309 | printf("prio %u", wrr->priority); > | ^~ > networking/tc.c:313:43: error: invalid use of undefined type ?struct tc_cbq_wrropt? > 313 | printf("/%u ", wrr->cpriority); > | ^~ > networking/tc.c:314:32: error: invalid use of undefined type ?struct tc_cbq_wrropt? > 314 | if (wrr->weight != 1) { > | ^~ > networking/tc.c:315:65: error: invalid use of undefined type ?struct tc_cbq_wrropt? > 315 | print_rate(buf, sizeof(buf), wrr->weight); > | ^~ > networking/tc.c:318:32: error: invalid use of undefined type ?struct tc_cbq_wrropt? > 318 | if (wrr->allot) > | ^~ > networking/tc.c:319:57: error: invalid use of undefined type ?struct tc_cbq_wrropt? > 319 | printf("allot %ub ", wrr->allot); > | ^~ > networking/tc.c:236:24: warning: unused variable ?tb? [-Wunused-variable] > 236 | struct rtattr *tb[TCA_CBQ_MAX+1]; > | ^~ > CC coreutils/rmdir.o > make[1]: *** [scripts/Makefile.build:197: networking/tc.o] Error 1 > make[1]: *** Waiting for unfinished jobs.... > > not really sure what's missing. any help would be appreciated ! > > > Thank you, > > Pavan Kumar > > _______________________________________________ > busybox mailing list > busybox at busybox.net > https://lists.busybox.net/mailman/listinfo/busybox From pavankumar14000 at gmail.com Fri May 23 04:32:47 2025 From: pavankumar14000 at gmail.com (Abothula Pavan Kumar) Date: Fri, 23 May 2025 10:02:47 +0530 Subject: networking: compilation error on ubuntu 24 In-Reply-To: References: Message-ID: Thank you Jeff, it worked. On Thu, 22 May 2025 at 22:56, Jeff Pohlmeyer wrote: > As a workaround, you can try disabling "tc". (Under networking->tc in > menuconfig, or CONFIG_TC in .config). > - Jeff > > > On Thu, May 22, 2025 at 12:08?PM Abothula Pavan Kumar > wrote: > > > > Hi, > > I'm running into multiple errors while trying to build busybox v1.36.1 > on Ubuntu 24.04. > > > > CC coreutils/realpath.o > > networking/tc.c: In function ?cbq_print_opt?: > > networking/tc.c:236:27: error: ?TCA_CBQ_MAX? undeclared (first use in > this function); did you mean ?TCA_CBS_MAX?? > > 236 | struct rtattr *tb[TCA_CBQ_MAX+1]; > > | ^~~~~~~~~~~ > > | TCA_CBS_MAX > > networking/tc.c:236:27: note: each undeclared identifier is reported > only once for each function it appears in > > miscutils/watchdog.c: In function ?watchdog_main?: > > CC util-linux/volume_id/ubifs.o > > miscutils/watchdog.c:161:17: warning: ignoring return value of ?write? > declared with attribute ?warn_unused_result? [-Wunused-result] > > 161 | write(3, "", 1); /* write zero byte */ > > | ^~~~~~~~~~~~~~~ > > miscutils/watchdog.c: In function ?shutdown_watchdog?: > > miscutils/watchdog.c:71:9: warning: ignoring return value of ?write? > declared with attribute ?warn_unused_result? [-Wunused-result] > > 71 | write(3, &V, 1); /* Magic, see watchdog-api.txt in > kernel */ > > | ^~~~~~~~~~~~~~~ > > CC libbb/get_volsize.o > > networking/tc.c:249:16: error: ?TCA_CBQ_RATE? undeclared (first use in > this function); did you mean ?TCA_TBF_RATE64?? > > 249 | if (tb[TCA_CBQ_RATE]) { > > | ^~~~~~~~~~~~ > > | TCA_TBF_RATE64 > > CC coreutils/rm.o > > CC networking/tcpudp_perhost.o > > CC util-linux/hwclock.o > > CC util-linux/volume_id/udf.o > > networking/tc.c:255:16: error: ?TCA_CBQ_LSSOPT? undeclared (first use in > this function) > > 255 | if (tb[TCA_CBQ_LSSOPT]) { > > | ^~~~~~~~~~~~~~ > > networking/tc.c:256:61: error: invalid application of ?sizeof? to > incomplete type ?struct tc_cbq_lssopt? > > 256 | if (RTA_PAYLOAD(tb[TCA_CBQ_LSSOPT]) < > sizeof(*lss)) > > | ^ > > CC util-linux/volume_id/util.o > > CC libbb/getopt32.o > > networking/tc.c:261:16: error: ?TCA_CBQ_WRROPT? undeclared (first use in > this function) > > 261 | if (tb[TCA_CBQ_WRROPT]) { > > | ^~~~~~~~~~~~~~ > > networking/tc.c:262:61: error: invalid application of ?sizeof? to > incomplete type ?struct tc_cbq_wrropt? > > 262 | if (RTA_PAYLOAD(tb[TCA_CBQ_WRROPT]) < > sizeof(*wrr)) > > | ^ > > AR miscutils/lib.a > > networking/tc.c:267:16: error: ?TCA_CBQ_FOPT? undeclared (first use in > this function) > > 267 | if (tb[TCA_CBQ_FOPT]) { > > | ^~~~~~~~~~~~ > > CC networking/telnet.o > > networking/tc.c:268:59: error: invalid application of ?sizeof? to > incomplete type ?struct tc_cbq_fopt? > > 268 | if (RTA_PAYLOAD(tb[TCA_CBQ_FOPT]) < > sizeof(*fopt)) > > | ^ > > CC util-linux/ionice.o > > networking/tc.c:273:16: error: ?TCA_CBQ_OVL_STRATEGY? undeclared (first > use in this function) > > 273 | if (tb[TCA_CBQ_OVL_STRATEGY]) { > > | ^~~~~~~~~~~~~~~~~~~~ > > CC networking/telnetd.o > > networking/tc.c:274:67: error: invalid application of ?sizeof? to > incomplete type ?struct tc_cbq_ovl? > > 274 | if (RTA_PAYLOAD(tb[TCA_CBQ_OVL_STRATEGY]) < > sizeof(*ovl)) > > | > ^ > > networking/tc.c:277:50: error: invalid application of ?sizeof? to > incomplete type ?struct tc_cbq_ovl? > > 277 | (unsigned) sizeof(*ovl)); > > | ^ > > networking/tc.c:293:23: error: invalid use of undefined type ?struct > tc_cbq_lssopt? > > 293 | if (lss && lss->flags) { > > | ^~ > > networking/tc.c:296:24: error: invalid use of undefined type ?struct > tc_cbq_lssopt? > > 296 | if (lss->flags&TCF_CBQ_LSS_BOUNDED) { > > | ^~ > > CC util-linux/volume_id/volume_id.o > > networking/tc.c:296:32: error: ?TCF_CBQ_LSS_BOUNDED? undeclared (first > use in this function) > > 296 | if (lss->flags&TCF_CBQ_LSS_BOUNDED) { > > | ^~~~~~~~~~~~~~~~~~~ > > networking/tc.c:300:24: error: invalid use of undefined type ?struct > tc_cbq_lssopt? > > 300 | if (lss->flags&TCF_CBQ_LSS_ISOLATED) { > > | ^~ > > CC libbb/getopt_allopts.o > > networking/tc.c:300:32: error: ?TCF_CBQ_LSS_ISOLATED? undeclared (first > use in this function) > > 300 | if (lss->flags&TCF_CBQ_LSS_ISOLATED) { > > | ^~~~~~~~~~~~~~~~~~~~ > > networking/tc.c:308:24: error: invalid use of undefined type ?struct > tc_cbq_wrropt? > > 308 | if (wrr->priority != TC_CBQ_MAXPRIO) > > | ^~ > > CC util-linux/ipcrm.o > > CC util-linux/volume_id/xfs.o > > CC networking/tftp.o > > networking/tc.c:308:38: error: ?TC_CBQ_MAXPRIO? undeclared (first use in > this function) > > 308 | if (wrr->priority != TC_CBQ_MAXPRIO) > > | ^~~~~~~~~~~~~~ > > networking/tc.c:309:46: error: invalid use of undefined type ?struct > tc_cbq_wrropt? > > 309 | printf("prio %u", wrr->priority); > > | ^~ > > networking/tc.c:313:43: error: invalid use of undefined type ?struct > tc_cbq_wrropt? > > 313 | printf("/%u ", wrr->cpriority); > > | ^~ > > networking/tc.c:314:32: error: invalid use of undefined type ?struct > tc_cbq_wrropt? > > 314 | if (wrr->weight != 1) { > > | ^~ > > networking/tc.c:315:65: error: invalid use of undefined type ?struct > tc_cbq_wrropt? > > 315 | print_rate(buf, sizeof(buf), > wrr->weight); > > | > ^~ > > networking/tc.c:318:32: error: invalid use of undefined type ?struct > tc_cbq_wrropt? > > 318 | if (wrr->allot) > > | ^~ > > networking/tc.c:319:57: error: invalid use of undefined type ?struct > tc_cbq_wrropt? > > 319 | printf("allot %ub ", wrr->allot); > > | ^~ > > networking/tc.c:236:24: warning: unused variable ?tb? [-Wunused-variable] > > 236 | struct rtattr *tb[TCA_CBQ_MAX+1]; > > | ^~ > > CC coreutils/rmdir.o > > make[1]: *** [scripts/Makefile.build:197: networking/tc.o] Error 1 > > make[1]: *** Waiting for unfinished jobs.... > > > > not really sure what's missing. any help would be appreciated ! > > > > > > Thank you, > > > > Pavan Kumar > > > > _______________________________________________ > > busybox mailing list > > busybox at busybox.net > > https://lists.busybox.net/mailman/listinfo/busybox > -------------- next part -------------- An HTML attachment was scrubbed... URL: From radoslav.kolev at suse.com Fri May 23 05:37:00 2025 From: radoslav.kolev at suse.com (Radoslav Kolev) Date: Fri, 23 May 2025 08:37:00 +0300 Subject: networking: compilation error on ubuntu 24 In-Reply-To: References: Message-ID: The reason is that the CBQ queuing discipline was removed from the Linux kernel some time ago. I you want to keep the tc command you can try this patch: https://build.opensuse.org/projects/openSUSE:Factory/packages/busybox/files/tc-no-TCA_CBQ.patch?expand=1 Regards, Radoslav On Fri, May 23, 2025 at 7:33?AM Abothula Pavan Kumar < pavankumar14000 at gmail.com> wrote: > Thank you Jeff, it worked. > > On Thu, 22 May 2025 at 22:56, Jeff Pohlmeyer > wrote: > >> As a workaround, you can try disabling "tc". (Under networking->tc in >> menuconfig, or CONFIG_TC in .config). >> - Jeff >> >> >> On Thu, May 22, 2025 at 12:08?PM Abothula Pavan Kumar >> wrote: >> > >> > Hi, >> > I'm running into multiple errors while trying to build busybox v1.36.1 >> on Ubuntu 24.04. >> > >> > CC coreutils/realpath.o >> > networking/tc.c: In function ?cbq_print_opt?: >> > networking/tc.c:236:27: error: ?TCA_CBQ_MAX? undeclared (first use in >> this function); did you mean ?TCA_CBS_MAX?? >> > 236 | struct rtattr *tb[TCA_CBQ_MAX+1]; >> > | ^~~~~~~~~~~ >> > | TCA_CBS_MAX >> > networking/tc.c:236:27: note: each undeclared identifier is reported >> only once for each function it appears in >> > miscutils/watchdog.c: In function ?watchdog_main?: >> > CC util-linux/volume_id/ubifs.o >> > miscutils/watchdog.c:161:17: warning: ignoring return value of ?write? >> declared with attribute ?warn_unused_result? [-Wunused-result] >> > 161 | write(3, "", 1); /* write zero byte */ >> > | ^~~~~~~~~~~~~~~ >> > miscutils/watchdog.c: In function ?shutdown_watchdog?: >> > miscutils/watchdog.c:71:9: warning: ignoring return value of ?write? >> declared with attribute ?warn_unused_result? [-Wunused-result] >> > 71 | write(3, &V, 1); /* Magic, see watchdog-api.txt in >> kernel */ >> > | ^~~~~~~~~~~~~~~ >> > CC libbb/get_volsize.o >> > networking/tc.c:249:16: error: ?TCA_CBQ_RATE? undeclared (first use in >> this function); did you mean ?TCA_TBF_RATE64?? >> > 249 | if (tb[TCA_CBQ_RATE]) { >> > | ^~~~~~~~~~~~ >> > | TCA_TBF_RATE64 >> > CC coreutils/rm.o >> > CC networking/tcpudp_perhost.o >> > CC util-linux/hwclock.o >> > CC util-linux/volume_id/udf.o >> > networking/tc.c:255:16: error: ?TCA_CBQ_LSSOPT? undeclared (first use >> in this function) >> > 255 | if (tb[TCA_CBQ_LSSOPT]) { >> > | ^~~~~~~~~~~~~~ >> > networking/tc.c:256:61: error: invalid application of ?sizeof? to >> incomplete type ?struct tc_cbq_lssopt? >> > 256 | if (RTA_PAYLOAD(tb[TCA_CBQ_LSSOPT]) < >> sizeof(*lss)) >> > | ^ >> > CC util-linux/volume_id/util.o >> > CC libbb/getopt32.o >> > networking/tc.c:261:16: error: ?TCA_CBQ_WRROPT? undeclared (first use >> in this function) >> > 261 | if (tb[TCA_CBQ_WRROPT]) { >> > | ^~~~~~~~~~~~~~ >> > networking/tc.c:262:61: error: invalid application of ?sizeof? to >> incomplete type ?struct tc_cbq_wrropt? >> > 262 | if (RTA_PAYLOAD(tb[TCA_CBQ_WRROPT]) < >> sizeof(*wrr)) >> > | ^ >> > AR miscutils/lib.a >> > networking/tc.c:267:16: error: ?TCA_CBQ_FOPT? undeclared (first use in >> this function) >> > 267 | if (tb[TCA_CBQ_FOPT]) { >> > | ^~~~~~~~~~~~ >> > CC networking/telnet.o >> > networking/tc.c:268:59: error: invalid application of ?sizeof? to >> incomplete type ?struct tc_cbq_fopt? >> > 268 | if (RTA_PAYLOAD(tb[TCA_CBQ_FOPT]) < >> sizeof(*fopt)) >> > | ^ >> > CC util-linux/ionice.o >> > networking/tc.c:273:16: error: ?TCA_CBQ_OVL_STRATEGY? undeclared (first >> use in this function) >> > 273 | if (tb[TCA_CBQ_OVL_STRATEGY]) { >> > | ^~~~~~~~~~~~~~~~~~~~ >> > CC networking/telnetd.o >> > networking/tc.c:274:67: error: invalid application of ?sizeof? to >> incomplete type ?struct tc_cbq_ovl? >> > 274 | if (RTA_PAYLOAD(tb[TCA_CBQ_OVL_STRATEGY]) < >> sizeof(*ovl)) >> > | >> ^ >> > networking/tc.c:277:50: error: invalid application of ?sizeof? to >> incomplete type ?struct tc_cbq_ovl? >> > 277 | (unsigned) sizeof(*ovl)); >> > | ^ >> > networking/tc.c:293:23: error: invalid use of undefined type ?struct >> tc_cbq_lssopt? >> > 293 | if (lss && lss->flags) { >> > | ^~ >> > networking/tc.c:296:24: error: invalid use of undefined type ?struct >> tc_cbq_lssopt? >> > 296 | if (lss->flags&TCF_CBQ_LSS_BOUNDED) { >> > | ^~ >> > CC util-linux/volume_id/volume_id.o >> > networking/tc.c:296:32: error: ?TCF_CBQ_LSS_BOUNDED? undeclared (first >> use in this function) >> > 296 | if (lss->flags&TCF_CBQ_LSS_BOUNDED) { >> > | ^~~~~~~~~~~~~~~~~~~ >> > networking/tc.c:300:24: error: invalid use of undefined type ?struct >> tc_cbq_lssopt? >> > 300 | if (lss->flags&TCF_CBQ_LSS_ISOLATED) { >> > | ^~ >> > CC libbb/getopt_allopts.o >> > networking/tc.c:300:32: error: ?TCF_CBQ_LSS_ISOLATED? undeclared (first >> use in this function) >> > 300 | if (lss->flags&TCF_CBQ_LSS_ISOLATED) { >> > | ^~~~~~~~~~~~~~~~~~~~ >> > networking/tc.c:308:24: error: invalid use of undefined type ?struct >> tc_cbq_wrropt? >> > 308 | if (wrr->priority != TC_CBQ_MAXPRIO) >> > | ^~ >> > CC util-linux/ipcrm.o >> > CC util-linux/volume_id/xfs.o >> > CC networking/tftp.o >> > networking/tc.c:308:38: error: ?TC_CBQ_MAXPRIO? undeclared (first use >> in this function) >> > 308 | if (wrr->priority != TC_CBQ_MAXPRIO) >> > | ^~~~~~~~~~~~~~ >> > networking/tc.c:309:46: error: invalid use of undefined type ?struct >> tc_cbq_wrropt? >> > 309 | printf("prio %u", wrr->priority); >> > | ^~ >> > networking/tc.c:313:43: error: invalid use of undefined type ?struct >> tc_cbq_wrropt? >> > 313 | printf("/%u ", wrr->cpriority); >> > | ^~ >> > networking/tc.c:314:32: error: invalid use of undefined type ?struct >> tc_cbq_wrropt? >> > 314 | if (wrr->weight != 1) { >> > | ^~ >> > networking/tc.c:315:65: error: invalid use of undefined type ?struct >> tc_cbq_wrropt? >> > 315 | print_rate(buf, sizeof(buf), >> wrr->weight); >> > | >> ^~ >> > networking/tc.c:318:32: error: invalid use of undefined type ?struct >> tc_cbq_wrropt? >> > 318 | if (wrr->allot) >> > | ^~ >> > networking/tc.c:319:57: error: invalid use of undefined type ?struct >> tc_cbq_wrropt? >> > 319 | printf("allot %ub ", >> wrr->allot); >> > | ^~ >> > networking/tc.c:236:24: warning: unused variable ?tb? >> [-Wunused-variable] >> > 236 | struct rtattr *tb[TCA_CBQ_MAX+1]; >> > | ^~ >> > CC coreutils/rmdir.o >> > make[1]: *** [scripts/Makefile.build:197: networking/tc.o] Error 1 >> > make[1]: *** Waiting for unfinished jobs.... >> > >> > not really sure what's missing. any help would be appreciated ! >> > >> > >> > Thank you, >> > >> > Pavan Kumar >> > >> > _______________________________________________ >> > busybox mailing list >> > busybox at busybox.net >> > https://lists.busybox.net/mailman/listinfo/busybox >> > _______________________________________________ > busybox mailing list > busybox at busybox.net > https://lists.busybox.net/mailman/listinfo/busybox > -------------- next part -------------- An HTML attachment was scrubbed... URL: From csokas.bence at prolan.hu Fri May 23 14:20:40 2025 From: csokas.bence at prolan.hu (=?UTF-8?B?Q3PDs2vDoXMgQmVuY2U=?=) Date: Fri, 23 May 2025 16:20:40 +0200 Subject: networking: compilation error on ubuntu 24 In-Reply-To: References: Message-ID: Hi! On 2025. 05. 23. 7:37, Radoslav Kolev wrote: > The reason is that the CBQ queuing discipline was removed from the Linux > kernel some time ago. > I you want to keep the tc command you can try this patch: https:// > build.opensuse.org/projects/openSUSE:Factory/packages/busybox/files/tc- > no-TCA_CBQ.patch?expand=1 openSUSE:Factory/packages/busybox/files/tc-no-TCA_CBQ.patch?expand=1> > > Regards, > Radoslav This should be integrated into mainline IMO, it is really annoying to have these build failures out-of-the-box on a modern system. Bence From noelle at noelle.dev Fri May 23 17:09:47 2025 From: noelle at noelle.dev (Noelle Leigh) Date: Fri, 23 May 2025 13:09:47 -0400 Subject: [PATCH] docs: Add links to cmd description from cmd list Message-ID: <20250523171016.99015-1-noelle@noelle.dev> In the generated `docs/busybox.pod` file, add a link for each command in the big command list that goes to that command's description, like a compact table of contents. This seems to only affect the generated HTML version of the usage page. To add `id` attributes to each usage section title, each command now uses `=head2` instead of `=item` for their section heading. To add links to each command in the list, the list was unindented so that it could use rich text, and each command was marked as code text (C<>) so they are styled in monospace. These changes mean that the HTML and mandoc command list will expand to fit the available width of the viewport, rather than wrapping at a fixed line-length. The plain text version retains its existing wrapping behavior. Because of the new code text formatting, `--quotes=none` was added to the pod2man and pod2text invocations in Makefile.custom to prevent the command list from quoting every single command. --- Makefile.custom | 4 ++-- applets/usage_pod.c | 15 ++++++++++----- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/Makefile.custom b/Makefile.custom index 6f679c4e1..ea5edb1a8 100644 --- a/Makefile.custom +++ b/Makefile.custom @@ -156,12 +156,12 @@ docs/busybox.pod: $(srctree)/docs/busybox_header.pod \ docs/BusyBox.txt: docs/busybox.pod $(disp_doc) $(Q)-mkdir -p docs - $(Q)-pod2text $< > $@ + $(Q)-pod2text --quotes=none $< > $@ docs/busybox.1: docs/busybox.pod $(disp_doc) $(Q)-mkdir -p docs - $(Q)-pod2man --center=busybox --release="version $(KERNELVERSION)" $< > $@ + $(Q)-pod2man --quotes=none --center=busybox --release="version $(KERNELVERSION)" $< > $@ docs/BusyBox.html: docs/busybox.net/BusyBox.html $(disp_doc) diff --git a/applets/usage_pod.c b/applets/usage_pod.c index 9e6d3f0ee..ab6e20297 100644 --- a/applets/usage_pod.c +++ b/applets/usage_pod.c @@ -67,30 +67,35 @@ int main(void) } if (col == 0) { col = 6; - printf("\t"); } else { printf(", "); } - printf("%s", usage_array[i].aname); + /* If the applet usage string will be included in the final document... */ + if (usage_array[i].usage[0] != NOUSAGE_STR[0]) { + /* ...optimistically link to its header (which is just the applet name). */ + printf("L|/\"%1$s\">", usage_array[i].aname); + } else { + /* Without a usage string, just output the applet name with no link. */ + printf("C<%s>", usage_array[i].aname); + } col += len2; } printf("\n\n"); printf("=head1 COMMAND DESCRIPTIONS\n\n"); - printf("=over 4\n\n"); for (i = 0; i < num_messages; i++) { if (usage_array[i].aname[0] >= 'a' && usage_array[i].aname[0] <= 'z' && usage_array[i].usage[0] != NOUSAGE_STR[0] ) { - printf("=item B<%s>\n\n", usage_array[i].aname); + /* This is the heading that will be linked from the command list. */ + printf("=head2 %s\n\n", usage_array[i].aname); if (usage_array[i].usage[0]) printf("%s %s\n\n", usage_array[i].aname, usage_array[i].usage); else printf("%s\n\n", usage_array[i].aname); } } - printf("=back\n\n"); return 0; } -- 2.43.0 From dmitry.klochkov at bell-sw.com Mon May 26 03:13:33 2025 From: dmitry.klochkov at bell-sw.com (Dmitry Klochkov) Date: Mon, 26 May 2025 06:13:33 +0300 Subject: [PATCH] last: fix ignoring the first login entry Message-ID: The first login entry is ignored if a log file contains more than one entries. For example: $ utmpdump wtmp.two Utmp dump of wtmp.two [7] [07810] [ts/2] [username] [pts/2 ] [192.168.255.114 ] ... [8] [07810] [ts/2] [ ] [pts/2 ] [ ] ... $ ln -sf $(realpath wtmp.two) /var/log/wtmp $ busybox last USER TTY HOST LOGIN TIME $ utmpdump wtmp.one Utmp dump of wtmp.one [7] [07810] [ts/2] [username] [pts/2 ] [192.168.255.114 ] ... $ ln -sf $(realpath wtmp.one) /var/log/wtmp $ busybox last USER TTY HOST LOGIN TIME username pts/2 192.168.255.114 May 14 11:12 To fix it, do not break the while loop if the offset is zero. --- util-linux/last.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util-linux/last.c b/util-linux/last.c index 7530d013d..aafd01bb9 100644 --- a/util-linux/last.c +++ b/util-linux/last.c @@ -157,7 +157,7 @@ int last_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM) ut.ut_user, ut.ut_line, ut.ut_host, ctime(&t_tmp) + 4); next: pos -= sizeof(ut); - if (pos <= 0) + if (pos < 0) break; /* done. */ xlseek(file, pos, SEEK_SET); } -- 2.49.0 From bmeng.cn at gmail.com Tue May 27 12:19:37 2025 From: bmeng.cn at gmail.com (Bin Meng) Date: Tue, 27 May 2025 20:19:37 +0800 Subject: [PATCH] getty: Prevent clang from reading the G pointer before it is assigned Message-ID: <20250527121937.1838-1-bmeng.cn@gmail.com> It was observed that getty crashes on RISC-V 64-bit target, with the busybox binary compiled by clang/LLVM 17 with -O2. Change getty's INIT_G() to use XZALLOC_CONST_PTR() instead to defeat the compiler optimization. Signed-off-by: Bin Meng --- loginutils/getty.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/loginutils/getty.c b/loginutils/getty.c index 4581cc9f7..8a2928577 100644 --- a/loginutils/getty.c +++ b/loginutils/getty.c @@ -110,7 +110,7 @@ struct globals { #define G (*ptr_to_globals) #define INIT_G() do { \ - SET_PTR_TO_GLOBALS(xzalloc(sizeof(G))); \ + XZALLOC_CONST_PTR(&ptr_to_globals, sizeof(G)); \ } while (0) //usage:#define getty_trivial_usage -- 2.34.1 From valentin.lab_busybox at kalysto.org Sat May 31 03:53:05 2025 From: valentin.lab_busybox at kalysto.org (Valentin Lab) Date: Sat, 31 May 2025 11:53:05 +0800 Subject: [PATCH] crond: reap orphaned grandchildren to prevent zombie buildup Message-ID: This patch fixes a long-standing zombie-process leak in crond that appears whenever crond itself is PID 1 (typical in minimal BusyBox containers). Reproducer ========== mkdir /tmp/test-root-crontabs -p echo "* * * * * sh -c 'sleep 1 &'" > "/tmp/test-root-crontabs/root" sudo chown root:root -R /tmp/test-root-crontabs ## Run busybox crond PID 1 docker run -d --rm --name busybox \ -v /tmp/test-root-crontabs/root:/var/spool/cron/crontabs/root:ro \ busybox:1.37.0-uclibc \ crond -f -d 0 > /dev/null watch -n 1 ' echo "Expecting more zombies in $((60 - 10#$(date +%S)))s (Ctrl-C to quit):" ps -ax -o pid,ppid,stat,comm | egrep "\s+Z\s+" ' echo "Cleaning busybox container" docker stop busybox You should see one new "sleep" zombie each minute. If crond is *not* PID 1 (e.g. started via a wrapper shell), the leak does not appear because the wrapper?now PID 1?reaps the orphans. Root cause ========== crond only calls `waitpid()` for PIDs it tracks. Background tasks (`sleep 5 &`) become orphans; the kernel re-parents them to PID 1. When crond *is* PID 1, it inherits these orphans but never waits for them, so they persist as zombies. Fix === Add a tiny reaper loop: while (waitpid(-1, NULL, WNOHANG) > 0); Placed at the end of `check_completions()`, it collects any remaining children. On systems where crond is **not** PID 1 the loop returns `-ECHILD` immediately, so behaviour and overhead are unchanged. Testing ======= * Reproduced the leak on `busybox:1.37.0-uclibc` and current git master. * Applied the patch, rebuilt BusyBox statically (with only crond), bind-mounted the binary into a fresh container; zombie count stays at 0 after X min. Suggested docker commmand for testing with compiled (static) binary in CWD: docker run --rm --name busybox \ -v /tmp/test-root-crontabs/root:/var/spool/cron/crontabs/root:ro \ -v $PWD/busybox:/bin/crond \ busybox:1.37.0-uclibc \ crond -f -d 0 * Verified crond still exits cleanly and runs scheduled jobs normally. Binary size impact (gcc 13.3.0, x86-64, `-Os`, static): +17 bytes. Thanks for your time and for maintaining BusyBox! Regards, Valentin Lab -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-crond-reap-orphaned-grandchildren-to-prevent-zombie-.patch Type: text/x-diff Size: 1662 bytes Desc: not available URL: From tashernadav at gmail.com Sat May 31 13:57:54 2025 From: tashernadav at gmail.com (Nadav Tasher) Date: Sat, 31 May 2025 16:57:54 +0300 Subject: [PATCH] crond: reap orphaned grandchildren to prevent zombie buildup In-Reply-To: References: Message-ID: Great catch! However, since the process status is never used (NULL provided to waitpid), why not just set the signal handler for SIGCHLD to SIG_IGN? This would significantly reduce the number of waitpid invocations. Nadav On Sat, May 31, 2025 at 11:53:05AM +0800, Valentin Lab wrote: > This patch fixes a long-standing zombie-process leak in crond that > appears whenever crond itself is PID 1 (typical in minimal BusyBox > containers). > > Reproducer > ========== > > mkdir /tmp/test-root-crontabs -p > echo "* * * * * sh -c 'sleep 1 &'" > "/tmp/test-root-crontabs/root" > sudo chown root:root -R /tmp/test-root-crontabs > > ## Run busybox crond PID 1 > docker run -d --rm --name busybox \ > -v /tmp/test-root-crontabs/root:/var/spool/cron/crontabs/root:ro \ > busybox:1.37.0-uclibc \ > crond -f -d 0 > /dev/null > > watch -n 1 ' > echo "Expecting more zombies in $((60 - 10#$(date +%S)))s (Ctrl-C to quit):" > ps -ax -o pid,ppid,stat,comm | egrep "\s+Z\s+" > ' > echo "Cleaning busybox container" > docker stop busybox > > > You should see one new "sleep" zombie each minute. > > If crond is *not* PID 1 (e.g. started via a wrapper shell), the leak > does not appear because the wrapper?now PID 1?reaps the orphans. > > > Root cause > ========== > > crond only calls `waitpid()` for PIDs it tracks. Background tasks > (`sleep 5 &`) become orphans; the kernel re-parents them to PID 1. > When crond *is* PID 1, it inherits these orphans but never waits for > them, so they persist as zombies. > > > Fix > === > > Add a tiny reaper loop: > > while (waitpid(-1, NULL, WNOHANG) > 0); > > Placed at the end of `check_completions()`, it collects any remaining > children. On systems where crond is **not** PID 1 the loop returns > `-ECHILD` immediately, so behaviour and overhead are unchanged. > > > Testing > ======= > > * Reproduced the leak on `busybox:1.37.0-uclibc` and current git master. > * Applied the patch, rebuilt BusyBox statically (with only crond), > bind-mounted the binary into a fresh container; zombie count stays at > 0 after X min. > > Suggested docker commmand for testing with compiled (static) binary in CWD: > > docker run --rm --name busybox \ > -v /tmp/test-root-crontabs/root:/var/spool/cron/crontabs/root:ro \ > -v $PWD/busybox:/bin/crond \ > busybox:1.37.0-uclibc \ > crond -f -d 0 > > * Verified crond still exits cleanly and runs scheduled jobs normally. > > Binary size impact (gcc 13.3.0, x86-64, `-Os`, static): +17 bytes. > > Thanks for your time and for maintaining BusyBox! > > Regards, > Valentin Lab > From 6bd536d80448485ebb5c12cb032286e97ddacb2a Mon Sep 17 00:00:00 2001 > From: Valentin Lab > Date: Sat, 31 May 2025 09:56:09 +0800 > Subject: [PATCH] crond: reap orphaned grandchildren to prevent zombie buildup > > If a cron job launches a background task, e.g. `sh -c "sleep 5 &"`, > the shell exits immediately and the `sleep` process is re-parented to > PID 1. When BusyBox `crond` itself happens to be PID 1 (common in a > minimal container), those orphans become direct children of `crond`. > Because `crond` only calls waitpid() for the PIDs it explicitly tracks, > these processes remain forever in Z state and the container slowly > fills with zombies. > > Add a small `while (waitpid(-1, NULL, WNOHANG) > 0)` sweep at the end > of check_completions() so any stray children are reaped. When `crond` > is not PID 1 the loop returns -ECHILD immediately, so behaviour and > overhead on a normal system are unchanged. > > Size impact: +12 bytes on x86-64 (gcc 13.3.0 -Os, static) > > Signed-off-by: Valentin Lab > --- > miscutils/crond.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/miscutils/crond.c b/miscutils/crond.c > index b3762d327..43d83b474 100644 > --- a/miscutils/crond.c > +++ b/miscutils/crond.c > @@ -1001,6 +1001,10 @@ static int check_completions(void) > /* else: r == 0: "process is still running" */ > file->cf_has_running = 1; > } > + > + /* Reap any other children we don't actively track */ > + while (waitpid(-1, NULL, WNOHANG) > 0); > + > //FIXME: if !file->cf_has_running && file->deleted: delete it! > //otherwise deleted entries will stay forever, right? > num_still_running += file->cf_has_running; > -- > 2.43.0 > > _______________________________________________ > busybox mailing list > busybox at busybox.net > https://lists.busybox.net/mailman/listinfo/busybox