Debian Patches

Status for busybox/1:1.36.1-7

Patch Description Author Forwarded Bugs Origin Last update
shell-ash-export-HOME.patch busybox sh sets but does not export PATH
This patch exports $PATH variable from busybox ash by default,
even if no "export PATH" statement has been processed. No
other shell (dash, bash, ...) does this:

$ env - /bin/bash -c /usr/bin/env
PWD=/tmp
SHLVL=1
_=/usr/bin/env

But after #329406, busybox ash started exporting this variable
by default. This change hasn't been sent upstream.

However, this turned out to be problematic, after many upstream
changes, busybox started segfaulting in interesting and difficult
to debug environments - like, when running as pid=1 in initramfs.
This is recorded in #679377.

The problem was that PATH was the only variable marked to be
exported by default, and this is done by this very patch. Other
exported variables were always malloc'ed, but this one was not.
But when ash executes applets marked as NOEXEC, it does not
really execute anything, it forks and runs the applet's main()
function, clearing and setting up the environment as it'd do
for any other command. There, it is assumed that all exported
variables were malloc'ed, and the function (tryexec() in ash.c)
writes to the place in exported variable where the equal sign
is. So, if ash inherited no PATH variable and the default is
used, the code will try to write \0 into a constant location,
and we'll get a segfault.

The whole patch is probably not needed (because other shells
don't export PATH by default), but at this stage (during wheezy
freeze) we can't just drop it, since it may lead to some random
breakage in some other random place (and that'll be another
very difficult to debug issue). So instead of dropping the
patch, we modify the PATH variable to be stored in non-const
location, ie, to be writable. It is safe, since the only
place which actually modifies this variable (after the first
half of this patch) is the awk main function, during setup,
it restores the overridden byte after touching it, and it
is a "terminal" applet, ie, it exits after doing its work.

For wheezy+1, we should drop this patch completely. For
now, we will live with this simple and ugly forkaround.

/mjt
Joey Hess <joeyh@debian.org> no debian 2006-05-07
version.patch build-sys: allow override of BB_BT (build tag) from command line Bastian Blank <waldi@debian.org> no 2008-03-28
init-console.patch skip non-existing devices in inittab
This patch causes init silently skip running processes from inittab if
the terminal name is specified but the corresponding device file does not
exist.
Bastian Blank <waldi@debian.org> no debian
stop-checking-ancient-kernel-version.patch stop checking ancient kernel version for NFS mount
The nfs mount code checks for ancient kernel 2.2.18 (!) to determine
which mount protocol to use (v3 or v4). Stop doing this, and always
use v4.

This is the only place in debian busybox which uses get_linux_version_code()
function which can't deal with less-than-3-component kernel version numbers
(#684611). (Other places are in modutils/ to determine whenever to use
pre-2.4 module loading way, which is disabled in debian build).

This is a band-aid patch, to minimize changes, more complete cleanup
is needed for all this code upstream.
Michael Tokarev <mjt@tls.msk.ru> no debian
revert-9c143ce52da11ec3d21a3491c3749841d3dc10f0.patch Revert 9c143ce52da11ec3d21a3491c3749841d3dc10f0 just to make sure the next patch can be applied Cyril Brulebois <kibi@debian.org> no 2019-03-29
temp-deb-installer-hack.patch Temporary hack re-enable invalid variable names
Upstream busybox commit b6838b520 ("ash: [VAR] Sanitise environment
variable names on entry") breaks assumptions used by debian-installer's
preseed system. This results in settings passed to the installer on the
kernel command-line getting stripped out if they contain invalid
characters in the variable name, such as '/', which is actually very
common in this use case.

This is not a long term fix for this problem: a different approach is
needed to parse the values from the kernel command-line, but we don't
want to be responsible for holding up the debian-installer alpha
release any longer than it has already.
Chris Boot <bootc@debian.org> not-needed
install-readlink-in-bin.patch no
spelling.diff Spelling: recevied, delimeter Michael Tokarev <mjt@tls.msk.ru> invalid 2022-05-08
platform-linux.diff [PATCH] buildsys: resurrect PLATFORM_LINUX and depend on it for linux-specific applets

This effectively reverts the following two commits:

commit e3b1a1fd28558f7a1b3c0ec33313bedb675be8a1
Author: Denys Vlasenko <vda.linux@googlemail.com>
Date: Sat Feb 26 22:24:08 2011 +0100

Replace "depends on PLATFORM_LINUX" with "select PLATFORM_LINUX"

and

commit 5c69ad0ecdc18cf51b312c7c82848f4438fe1c8d
Author: Ron Yorston <rmy@pobox.com>
Date: Tue Aug 4 08:24:19 2020 +0100

build system: drop PLATFORM_LINUX

but does, hopefully, the right thing.

Original complain was that the allnoconfig turns off PLATFORM_LINUX
on which all linux-specific applets depends. Instead of setting this
config option right for linux and non-linux (initially it was just a
regular kconfig symbol, not set depending on the platform), it were
turned into something which made little sense (in the first commit),
and later dropped completely.

So introduce a dynamic kconfig symbol PLATFORM_LINUX with the value
actually depending on the target platform, so that it is not affected
by all{yes|no|whatever}config. This way, it is possible to depend on
it for linux-specific applets without breaking *config anymore.

It is done by creating a small kconfig fragment, .platform.in, to
define just PLATFORM_LINUX symbol. It is created in Makefile if
${CPP} has __linux__ #defined. And include it in the top-level Config.in.

Regenerate default config files with the new symbol.

And mark all the applets which were marked as "select PLATFORM_LINUX"
before the "build system: drop PLATFORM_LINUX" commit, as
"depends on PLATFORM_LINUX".

Also mark 2 other applets, tc and dhcprelay, as linux-only too.

This way, it is finally possible to build busybox on other platforms
without really huge efforts to maintain list of "incompatible" applets
externally, and does not put any pressure on the main development, -
the only thing needed is to keep the existing "depends on PLATFORM_LINUX"
lines.
Michael Tokarev <mjt@tls.msk.ru> no 2022-11-04
fix-non-linux-build.patch Fix non-Linux builds
Some features are Linux-only.

diff --git a/networking/traceroute.c b/networking/traceroute.c
index 4bbe1ab8e..2ba990fd0 100644
Samuel Thibault <samuel.thibault@ens-lyon.org> no 2022-10-16
syslogd-decrease-stack-usage-50-bytes.patch [PATCH] syslogd: decrease stack usage, ~50 bytes
function old new delta
syslogd_init - 1007 +1007
syslogd_main 1619 636 -983
Denys Vlasenko <vda.linux@googlemail.com> no 2023-06-13
syslogd-daemonize-after-init-make-errs-visible.patch [PATCH] syslogd: daemonize _after_ init (so that init errors are visible, if they occur) Denys Vlasenko <vda.linux@googlemail.com> no 2023-06-13
syslogd-fix-breakage-caused-by-daemonize-_after_-ini.patch [PATCH] syslogd: fix breakage caused by "daemonize _after_ init" change

function old new delta
syslogd_init 1007 1140 +133
create_socket 143 - -143
Denys Vlasenko <vda.linux@googlemail.com> no 2023-10-03
syslogd-option_mask32.patch syslogd problem
diff --git a/sysklogd/syslogd.c b/sysklogd/syslogd.c
index 83b5c0cf6..97578813b 100644
Jeff Pohlmeyer <yetanothergeek@gmail.com> invalid 2023-09-21
syslogd-make-it-optionally-systemd-socket-activated.patch syslogd: make it optionally systemd-socket-activated
In order for busybox-syslogd to work with systemd, it needs to be
This patch implements very basic of sd_listen_fds(3) for syslogd context.
We only check for single LISTEN_FD and require it to be AF_LINUX socket.

diff --git a/sysklogd/syslogd.c b/sysklogd/syslogd.c
index 6ddfd771a..b7d0fbe6b 100644
Michael Tokarev <mjt@tls.msk.ru> no 2023-11-16
install-fix-chown-resetting-suid-sgid-bits-from-chmod.patch [PATCH] install: Fix chown resetting suid/sgid bits from chmod
Since Linux 2.2.13, chown(2) resets the suid/gid bits for all users.
This patch changes the ordering so that chmod gets called after chown.

This behavior follows GNU coreutils.
Nero <nero@w1r3.net> no 2023-09-23

All known versions for source package 'busybox'

Links