Commit Graph

176 Commits (4a6795409d1520fd3da3e909a8bcf9d7fd0927bb)

Author SHA1 Message Date
Rui Salvaterra eb24a57b7f busybox: store applet usage messages uncompressed
The rootfs squashfs is already highly (XZ) compressed. Storing the applet
messages in compressed form will increase the entropy and reduce the overall
image compression ratio.

Size diffs (compressed vs uncompressed):

busybox (the executable): 364596 vs 384804 bytes.

OpenWrt target images (the kernel image is unchanged, obviously):

 omnia-medkit-openwrt-mvebu-cortexa9-cznic_turris-omnia-initramfs.tar.gz:

  9163597 vs 9162531 bytes (1066 bytes difference).

openwrt-mvebu-cortexa9-cznic_turris-omnia-initramfs-kernel.bin:

  9161688 vs 9160600 bytes (1088 bytes difference).

openwrt-mvebu-cortexa9-cznic_turris-omnia-sysupgrade.img.gz:

 9729550 vs 9729230 bytes (320 bytes difference).

All in all, we save just a little bit over 1 kiB. As an added bonus, we
also don't have to decompress the messages twice, (first from squashfs,
then from the bzip2 message storage).

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
[added additional size comparision diff detaisl]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years ago
Rui Salvaterra c5c652e5ad busybox: use CLOCK_MONOTONIC instead of gettimeofday
The clock_gettime(CLOCK_MONOTONIC) syscall exists for so long that the first
kernel version to support it is not even specified in the man page [1]. Let's
enable it on BusyBox by default. Otherwise, gettimeofday will be used instead,
which will give wrong results if the date/time is reset (time moving backwards).

[1] https://linux.die.net/man/2/clock_gettime

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
4 years ago
Hauke Mehrtens 7637b84fde busybox: backport Remove stime() function calls
glibc 2.31 does not provide stime() any more, backport a fix from
current busybox master to avoid using this function.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
4 years ago
Eneas U de Queiroz 1da014fcca busybox: quote 'source' filenames in Config.in
Newer versions of the kconfig program requires quoting the arguments of
the 'source' directive.  These are the last ones not using them.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
4 years ago
Rafał Miłecki 547f1ec25a busybox: enable truncate on bcm53xx target
It's needed for optimized sysupgrade. On host machine this change
increased busybox size by 4096 B.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
4 years ago
John Crispin d9cfa827ac busybox: fix build issues
Fixes: f704f97e4c ("busybox: Include hdparm by default on nas type device")
Signed-off-by: John Crispin <john@phrozen.org>
4 years ago
Linus Walleij f704f97e4c busybox: Include hdparm by default on nas type device
NAS devices certainly need to have hdparm to configure
things like spin-down time or their disks will be
constantly spinning. Just catenate CONFIG_HDPARM=y
on these configs.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
4 years ago
Satadru Pramanik f1410902e6 busybox: add glibc dependency for vi regex option
Build with musl libc fails with BUSYBOX_DEFAULT_FEATURE_VI_REGEX_SEARCH
enabled. Enabling BusyBox's vi regex search option depends upon GNU
regex.  Musl libc does not support GNU regex[1].

So this patch adds explicit dependency on GNU libc and while at it
remove the FIXME comment.

1. https://wiki.musl-libc.org/functional-differences-from-glibc.html

Ref: https://dev.archive.openwrt.org/ticket/21741.html
Ref: https://forum.openwrt.org/t/busybox-not-compiling/
Ref: https://github.com/openwrt/packages/issues/4453
Signed-off-by: Satadru Pramanik <satadru@umich.edu>
[commit subject/description tweaks, From: fix, USE_GLIBC fix, removed comments]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
Hannu Nyman 5b3f0e70a1 busybox: update to 1.31.1
Update busybox to 1.31.1

Small bug fix release. Fixes for dc, ash (PS1 expansion fix),
hush, dpkg-deb, telnet and wget.

No need to refresh patches or config.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
5 years ago
Henrique de Moraes Holschuh 8eab0a0036 busybox: disable default config option FEATURE_SUID=y
Commit ad7c6102f2 ("busybox: fix missing install with suid bit set if
FEATURE_SUID=y") actually fixes BUSYBOX_CONFIG_FEATURE_SUID option and
thus would install busybox setuid root by default which would result in
possibly unwanted change of current behaviour, so let's disable this
option by default in order to preserve the current status-quo.

For the record: disabling FEATURE_SUID to preserve the status-quo does
*not* imply the current status-quo is "safer", or for that matter, in
any way desireable.  That is a discussion to be had on the mailing
lists.

Switching the FEATURE_SUID default to "n" is simply a compromise to
facilitate the merge of the changes that unbreak FEATURE_SUID.

Ref: PR#2502
Signed-off-by: Henrique de Moraes Holschuh <henrique@nic.br>
[commit title/description facelift]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
Henrique de Moraes Holschuh ad7c6102f2 busybox: fix missing install with suid bit set if FEATURE_SUID=y
With FEATURE_SUID=y one can install busybox binary belonging to root
with the suid bit set, enabling some applets to perform root-level
operations even when run by ordinary users. Busybox then drops
privileges for applets that don't need root access, before entering
their main() function.

Currently we don't install busybox binary with suid bit set, rendering
this feature unusable.

Note that we can't just "chmod u+s /bin/busybox" at runtime as a
"cheaper" solution: it would waste approximately 200KiB of FLASH (the
whole /bin/busybox binary gets copied into the overlay).

Ref: PR#2502
Signed-off-by: Henrique de Moraes Holschuh <henrique@nic.br>
[commit title/description facelift, use INSTALL_SUID variable]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
Emil Muratov afa5ce2493 busybox: enable swapon/off by default to make it consistent with mkswap
No size increase on busybox binary.
  Since busybox mkswap is already enabled by default it seems reasonable
  to enable swapon/off too. For ex. this obsoletes installing block-mount
  dependency for zram-swap.

Signed-off-by: Emil Muratov <gpm@hotplug.ru>
5 years ago
Hannu Nyman 696c511fb4 busybox: update to 1.31.0
* Update busybox to version 1.31.0.
    New applets: ts, i2ctransfer
    New (restored) feature: error/info levels in syslog messages.
    Leave new features disabled by default.
* Refresh patches
* Remove patch that was backported from upstream

Config refreshed with commands below, after which the OpenWrt specific
config defaults (ipv6, login session child) were corrected:

  make package/busybox/compile   (to populate the build_dir)

  cd package/utils/busybox/config/
  ../convert_menuconfig.pl ../../../../build_dir/target-mips_24kc_musl/busybox-1.31.0

  cd package/utils/busybox
  ./convert_defaults.pl < ../../../build_dir/target-mips_24kc_musl/busybox-1.31.0/.config > Config-defaults.in

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
5 years ago
Yousong Zhou 62be427067 busybox: strip off ALTERNATIVES spec
Now that busybox is a known alternatives provider by opkg, we remove the
ALTERNATIVES spec and add a note to make the implicit situation clear

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
5 years ago
Konstantin Demin 10011f91c5 busybox: add ALTERNATIVES for brctl
Busybox brctl applet conflicts with the version from bridge-utils.
Fix this by using ALTERNATIVE support for brctl in busybox.

Signed-off-by: Konstantin Demin <rockdrilla@gmail.com>
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com> [PKG_RELEASE increase]
5 years ago
Mikael Magnusson 8128a7e4fc busybox: fix: ip addr flush hangs when run by non-root user
Add upstream patch from:
https://git.busybox.net/busybox/commit/?id=028c5aa18b5273c029f0278232d922ee1a164de6

The patch fixes a problem with an infinite loop causing 100% CPU usage
when running the following command /lib/preinit/10_indicate_preinit
without the CAP_NET_ADMIN capability (such as in Docker):
  ip -4 address flush dev $pi_ifname

Signed-off-by: Mikael Magnusson <mikma@users.sourceforge.net>
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com> [refresh patch]
5 years ago
Hans Dedecker 2cd28c9a08 busybox: add missing install dir
Add missing /usr/sbin install dir fixing :

install: cannot create regular file 'build_dir/target-x86_64_musl/busybox-1.30.1/.pkgdir/busybox/usr/sbin/ntpd-hotplug': No such file or directory

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
5 years ago
Yousong Zhou eb6f5a58b9 busybox: sync Config.in files
The change was made with the following commands

	cd package/utils/busybox/config
	../convert_menuconfig.pl ~/git-repo/openwrt/openwrt/build_dir/target-mips_24kc_musl/busybox-1.30.1

convert_defaults.pl has no changes other than overwriting defaults for
BUSYBOX_DEFAULT_FEATURE_IPV6

Resolves FS#2146

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
5 years ago
Yousong Zhou 157072ea2b busybox: unindent busybox Config.in
This is to align with upstream change 72089cf ("config: deindent all
help texts") and to make the follow-up change syncing Config.in files
with current busybox version more reviewable

It was made with the following commands

	cd package/utils/busybox/config
	find . -name 'Config.in' | xargs sed -ir -e 's/^\t  \([^ ]\)/\t\1/'

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
5 years ago
Hannu Nyman 94993a79f8 busybox: update to 1.30.1
Minor bugfix release. Fixes for
 * bc/dc
 * sed (backslash parsing for 'w' command)
 * ip (vlan fixes)
 * grep (fixes for -x -v)
 * ls (-i compat)

No need to refresh patches or config defaults

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
5 years ago
Val Kulkov ed514e7f9e busybox: keep syslog.conf during sysupgrade
If a user finds that logd is too barebone for their needs and wishes
to have more control over syslog, the user presently has an option
to enable CONFIG_BUSYBOX_CONFIG_FEATURE_SYSLOG and configure syslog
with settings in /etc/syslog.conf.

Presently /etc/syslog.conf silently disappears on sysupgrade. This
patch prevents such unwanted behaviour if busybox syslog is enabled
via CONFIG_BUSYBOX_CONFIG_FEATURE_SYSLOG.

Signed-off-by: Val Kulkov <val.kulkov@gmail.com>
5 years ago
Andy Walsh 94f6030170 librpc: remove package
* replaced with packages/libtirpc
* remove busybox options rarely used/deprecated
BUSYBOX_CONFIG_FEATURE_MOUNT_NFS
BUSYBOX_CONFIG_FEATURE_INETD_RPC

Signed-off-by: Andy Walsh <andy.walsh44+github@gmail.com>
5 years ago
Jo-Philipp Wich 1211832977 busybox: handle crypt() errors in loginutils
The crypt(3) function is allowed to fail with either EINVAL or ENOSYS when
the given salt is either invalid or when the requested algorithm is not
implemented.

In such a case, libbb's pw_encrypt() function will silently convert the
crypt() NULL return value into an empty string which is then processed
without further errors by utilities such as chpasswd or passwd, causing
them to set an empty password when an unsupported cipher is requested.

Patch the relevant users of pw_encrypt() to abort in case an empty hash
is returned by pw_encrypt() in order to mitigate the problem.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years ago
Jeffery To d13e86d4c2 procd: Add wrapper for uci_validate_section()
This adds a wrapper (uci_load_validate) for uci_validate_section() that
allows callers (through a callback function) to access the values set by
uci_validate_section(), without having to manually declare a
(potentially long) list of local variables.

The callback function receives two arguments when called, the config
section name and the return value of uci_validate_section().

If no callback function is given, then the wrapper exits with the value
returned by uci_validate_section().

This also updates several init scripts to use the new wrapper function.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
5 years ago
Hans Dedecker 7a4075bd10 busybox: fix ALTERNATIVES alphabetical ordering
Commit 3f0eb71dae added ALTERNATIVES for wget but not in correct
alphabetical order; increase PKG_RELEASE as well.

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
5 years ago
Hans Dedecker 3f0eb71dae busybox: add ALTERNATIVES for wget
Busybox wget applet conflicts with the version from uclient.
Fix this by using ALTERNATIVE support for wget in busybox.

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
5 years ago
Daniel F. Dickinson a54129d8aa busybox: Add ALTERNATIVES for findutils
Currently busybox find and xargs conflict with the versions from
findutils package.  Fix this by using ALTERNATIVES in busybox
and the related findutils (from packages feed) commit.

The conflict is due to the binaries being in the the same place
in rootfs and opkg not being happy about that.

Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com> [PKG_RELEASE increase]
5 years ago
Hannu Nyman 9b9274342c busybox: update to 1.30.0
Update busybox to 1.30.0.
Refresh patches.
Leave new features disabled by default.

Config refreshed via:

  cd package/utils/busybox/config/
  ../convert_menuconfig.pl ../../../../build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/busybox-1.30.0

  make package/busybox/compile

  cd package/utils/busybox
  ./convert_defaults.pl < ../../../build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/busybox-1.30.0/.config > Config-defaults.in

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
5 years ago
Hans Dedecker ec9576607d busybox: fix IPv6 dependency
Commit 9f0cb135dd made BUSYBOX_CONFIG_FEATURE_IPV6 dependant on IPV6 but
did not make its default value BUSYBOX_DEFAULT_FEATURE_IPV6 dependant
on IPV6. BUSYBOX_DEFAULT_FEATURE_IPV6 will have as default value y if
IPV6 is enabled otherwise n.

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
6 years ago
Rosy Song 9f0cb135dd busybox: fix dependency for IPV6
Signed-off-by: Rosy Song <rosysong@rosinson.com>
6 years ago
Hannu Nyman 4a3298c124 busybox: update to 1.29.3
Update busybox to 1.29.3, minor bugfix release

https://git.busybox.net/busybox/log/?h=1_29_3

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
6 years ago
Rob Mosher 8a3582fa8a busybox: prevent compile hang with bzip2 enabled
The BZIP2_SMALL option was not being exposed via Config.in which
caused the build to fail as 'yes' is piped to the config during
build.  As it's expecting a number, it gets stuck in a loop.

Signed-off-by: Rob Mosher <nyt-openwrt@countercultured.net>
6 years ago
Hannu Nyman 12fb4bb834 busybox: update to 1.29.2
* Update busybox to 1.29.2
* refresh default config
* remove upstreamed patches

Config refreshed with
  cd config/
  ../convert_menuconfig.pl ../../../../build_dir/target-arm_cortex-a9+vfpv3_musl_eabi/busybox-1.29.2
  cd ..
  ./convert_defaults.pl < ../../../build_dir/target-arm_cortex-a9+vfpv3_musl_eabi/busybox-1.29.2/.config > Config-defaults.in

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
Tested-by: Hans Dedecker <dedeckeh@gmail.com>
6 years ago
Felix Fietkau 8c11133c9d busybox: compile with LTO enabled
In the default configuration on MIPS, it reduces the .ipk size
from 214k to 207k

Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years ago
Hans Dedecker b8bdeace39 busybox: rename udhcpc-remove-code-which-requires-server-ID-to-be-on patch
Move udhcpc-remove-code-which-requires-server-ID-to-be-on patch from 500
to 400

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
6 years ago
Hans Dedecker c6e50075f2 busybox: udhcpc: replace udhcpc_no_msg_dontroute patch by upstream fix
Replace 204-udhcpc_no_msg_dontroute patch by the upstream busybox fix
which removes the code which requires the server ID to be on local
network

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
6 years ago
Magnus Kroken ccc728a0e2 busybox: update to 1.28.4
Signed-off-by: Magnus Kroken <mkroken@gmail.com>
6 years ago
Paul Spooren cbf69fb2ad cron: add procd listeners for crontabs
Add procd file listeners to check files in `/etc/crontabs/`.

Also unified a bit the function style.

Signed-off-by: Paul Spooren <mail@aparcar.org>
6 years ago
Adi Shammout e4259bed3f busybox: udhcpc: no MSG_DONTROUTE when sending packet
This reverts a change made in Sep 2017 [1] which introduced
MSG_DONTROUTE flag to prevent udhcpc from reaching out to servers on a
different subnet. That change violates RFC2131 by forcing fully
configured clients, who got their configurations through an offer
relayed by a DHCP relay, from renewing through a unicast request
directly to the DHCP server, resulting in the client resorting to
boradcasting lease extension requests instead of unicasting them,
further breaking RFC2131.

The problem with MSG_DONTROUTE appears when talking to a properly
configured DHCP server that rejects non-compliant requests. Such server
will reject lease extension attempts sent via broadcast rather than
unicast, as is the case with Finnish ISPs Telia and DNA as well as
Estonian ISP Starman. Once the lease expires without renewal, udhcpc
enters init mode, taking down the interfaces with it, and thus causing
interruption on every lease expiry. On some ISPs (such as the ones
mentioned above) that can be once every 10-20 minutes. The interruptions
appear in the logs as such:
----
udhcpc: sending renew to x.x.x.x
udhcpc: send: Network unreachable
udhcpc: sending renew to 0.0.0.0
udhcpc: sending renew to 0.0.0.0
...
udhcpc: lease lost, entering init state
Interface 'wan' has lost the connection
Interface 'wan' is now down
Network alias 'eth0' link is down
udhcpc: sending select for y.y.y.y
udhcpc: lease of y.y.y.y obtained, lease time 1200
Network alias 'eth0' link is up
Interface 'wan' is now up
----

During lease extension, a fully configured client should be able to
reach out to the server from which it recieved the lease for extension,
regardless in which network it is; that's up to the gateway to find. [2]
This patch ensures that.

[1]
http://lists.busybox.net/pipermail/busybox-cvs/2017-September/037402.html
[2]
https://www.netmanias.com/en/post/techdocs/6000/dhcp-network-protocol/
understanding-dhcp-relay-agents

Signed-off-by: Adi Shammout <adi.shammout@outlook.com>
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com> [PKG_RELEASE increase]
6 years ago
Yousong Zhou f87dff8f72 flock: enable alternatives support
Fixes FS#1510

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
6 years ago
Yousong Zhou 46a2c0d9c5 busybox: order alternatives in alphabetical order
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
6 years ago
Hannu Nyman c089671339 busybox: update to 1.28.3
Bug fix release. 1.28.3 has fixes for
* ash and hush (do not leave stray open file destriptors in children),
* cpio (fix for symlink extraction),
* grep ("grep -Fw a" was matching "aa").

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
6 years ago
Hannu Nyman d674422a81 busybox: update to 1.28.2
Update busybox to 1.28.2, refresh patches and default config.

* modify 230-add_nslookup_lede.patch as opt_complementary was removed
    Also move nslookup_longopts variable declaration to be inside
    the same conditional as the function itself.
* modify 250-date-k-flag.patch to match upstream (opt_complementary)
* remove 600-cve-2017-16544.patch that is upstreamed

Notes about config changes:
* Some applet-specific LONG_OPTIONS config options were removed
* Config help text indentation changed, caused lots of
  text formatting changes for convert_menuconfig.pl
* convert_defaults.pl moved lots of defaults around, summary of
  actual changes below

New applets/features:
---------------------
ARCH
HEXEDIT
MINIPS
NETCAT
NUKE
RESUME
RUN_INIT
SETFATTR

New options:
------------
FEATURE_CATN
FEATURE_CROND_SPECIAL_TIMES
FEATURE_LIBBUSYBOX_STATIC
FEATURE_SETPRIV_CAPABILITIES
FEATURE_SETPRIV_CAPABILITY_NAMES
FEATURE_SETPRIV_DUMP
FEATURE_SH_READ_FRAC
FEATURE_SWAPONOFF_LABEL
FEATURE_VOLUMEID_MINIX
FEATURE_XARGS_SUPPORT_ARGS_FILE
FEATURE_XARGS_SUPPORT_PARALLEL
HUSH_GETOPTS
HUSH_READONLY
HUSH_TIMES

Removed:
--------
FEATURE_HAVE_RPC
MSH

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
6 years ago
Hans Dedecker 02fba1a181 busybox: drop providing virtual package ip
Drop providing the virtual package ip by busybox which was added in commit
1cec4d4ef0.

Letting busybox provide the virtual package ip is not optimal for the
following reasons :

	- Applications depending on ip expect either the ip-full or
	  ip-tiny package to be enabled.
	- Busybox ip applet cannot be added or removed at runtime

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
6 years ago
Matthias Schiffer b8d9a064f0
busybox: remove i386-specific build flags
busybox tries to be smart and passes a number of additional flags to the
compiler. Unfortunately, the i386-specific flags break ABI compatiblity
with libc.

Fixes busybox crashes observed on x86-generic with GCC 7.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
6 years ago
Julien Dusser df0bd42fde build: add hardened builds with PIE (ASLR) support
Introduce a configuration option to build a "hardened" OpenWrt with
ASLR PIE support.

Add new option PKG_ASLR_PIE to enable Address Space Layout Randomization (ASLR)
by building Position Independent Executables (PIE). This new option protects
against "return-to-text" attacks.

Busybox need a special care, link is done with ld, not gcc, leading to
unknown flags. Set BUSYBOX_DEFAULT_PIE instead and disable PKG_ASLR_PIE.

If other failing packages were found, PKG_ASLR_PIE:=0 should be added to
their Makefiles.

Original Work by: Yongkui Han <yonhan@cisco.com>
Signed-off-by: Julien Dusser <julien.dusser@free.fr>
6 years ago
Kevin Darbyshire-Bryant b61a648e4a busybox: clean up patch fuzz
Refresh patches to tidy up fuzz.  No functional changes

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
6 years ago
Roman Yeryomin 2277cd1249 busybox: enable flock by default
This is needed for procd init script protection to work.
flock adds 4248 bytes to stripped busybox binary.

Signed-off-by: Roman Yeryomin <roman@advem.lv>
6 years ago
John Crispin 7c0a2bc930 busybox: backport cve-2017-16544 fix
In the add_match function in libbb/lineedit.c in BusyBox through 1.27.2,
the tab autocomplete feature of the shell, used to get a list of filenames
in a directory, does not sanitize filenames and results in executing any
escape sequence in the terminal. This could potentially result in code
execution, arbitrary file writes, or other attacks.

Fixes: FS#1181 - CVE-2017-16544:

Backport the patch from:
https://git.busybox.net/busybox/commit/?id=c3797d40a1c57352192c6106cc0f435e7d9c11e8
https://nvd.nist.gov/vuln/detail/CVE-2017-16544

Signed-off-by: Derek Werthmuller <thewerthfam@gmail.com>
Signed-off-by: John Crispin <john@phrozen.org>
6 years ago
Matthias Schiffer 20c349f68c
busybox: add missing TARGET_CPPFLAGS and TARGET_LDFLAGS
Unconditionally pass TARGET_CPPFLAGS (not passed at all before) and
TARGET_LDFLAGS (passed only in certain non-default configuration before the
Makefile streamlining). Without these flags, hardening options
(PKG_FORTIFY_SOURCE and PKG_RELRO) were not actually applied to busybox.

The addition of these flags increases the size of the stripped busybox
binary by about 6KB (~4KB with fortify headers, ~2KB with "-znow -zrelro")
with the default hardening options PKG_FORTIFY_SOURCE_1 and PKG_RELRO_FULL.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
6 years ago