busybox: update to version 1.23.2
Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 45272
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
--- a/include/libbb.h
|
||||
+++ b/include/libbb.h
|
||||
@@ -35,6 +35,7 @@
|
||||
#include <sys/poll.h>
|
||||
@@ -40,6 +40,7 @@
|
||||
#include <poll.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/mman.h>
|
||||
+#include <sys/resource.h>
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
--- a/shell/ash.c
|
||||
+++ b/shell/ash.c
|
||||
@@ -13014,7 +13014,7 @@ init(void)
|
||||
setvar2("PPID", utoa(getppid()));
|
||||
#if ENABLE_ASH_BASH_COMPAT
|
||||
p = lookupvar("SHLVL");
|
||||
- setvar2("SHLVL", utoa(p ? atoi(p) + 1 : 1));
|
||||
+ setvar("SHLVL", utoa((p ? atoi(p) : 0) + 1), VEXPORT);
|
||||
#endif
|
||||
p = lookupvar("PWD");
|
||||
if (p) {
|
||||
@@ -1,30 +0,0 @@
|
||||
--- a/libbb/time.c
|
||||
+++ b/libbb/time.c
|
||||
@@ -68,15 +68,23 @@ void FAST_FUNC parse_datestr(const char
|
||||
/* else end != NUL and we error out */
|
||||
}
|
||||
} else
|
||||
- /* yyyy-mm-dd HH */
|
||||
- if (sscanf(date_str, "%u-%u-%u %u%c", &ptm->tm_year,
|
||||
+ if (strchr(date_str, '-')
|
||||
+ /* Why strchr('-') check?
|
||||
+ * sscanf below will trash ptm->tm_year, this breaks
|
||||
+ * if parse_str is "10101010" (iow, "MMddhhmm" form)
|
||||
+ * because we destroy year. Do these sscanf
|
||||
+ * only if we saw a dash in parse_str.
|
||||
+ */
|
||||
+ /* yyyy-mm-dd HH */
|
||||
+ && (sscanf(date_str, "%u-%u-%u %u%c", &ptm->tm_year,
|
||||
&ptm->tm_mon, &ptm->tm_mday,
|
||||
&ptm->tm_hour,
|
||||
&end) >= 4
|
||||
- /* yyyy-mm-dd */
|
||||
- || sscanf(date_str, "%u-%u-%u%c", &ptm->tm_year,
|
||||
+ /* yyyy-mm-dd */
|
||||
+ || sscanf(date_str, "%u-%u-%u%c", &ptm->tm_year,
|
||||
&ptm->tm_mon, &ptm->tm_mday,
|
||||
&end) >= 3
|
||||
+ )
|
||||
) {
|
||||
ptm->tm_year -= 1900; /* Adjust years */
|
||||
ptm->tm_mon -= 1; /* Adjust month from 1-12 to 0-11 */
|
||||
@@ -1,19 +0,0 @@
|
||||
--- a/networking/libiproute/iplink.c
|
||||
+++ b/networking/libiproute/iplink.c
|
||||
@@ -31,6 +31,16 @@
|
||||
#ifndef IFLA_LINKINFO
|
||||
# define IFLA_LINKINFO 18
|
||||
# define IFLA_INFO_KIND 1
|
||||
+# define IFLA_INFO_DATA 2
|
||||
+#endif
|
||||
+
|
||||
+#ifndef IFLA_VLAN_MAX
|
||||
+# define IFLA_VLAN_ID 1
|
||||
+# define IFLA_VLAN_FLAGS 2
|
||||
+struct ifla_vlan_flags {
|
||||
+ uint32_t flags;
|
||||
+ uint32_t mask;
|
||||
+};
|
||||
#endif
|
||||
|
||||
/* taken from linux/sockios.h */
|
||||
@@ -1,15 +0,0 @@
|
||||
--- a/networking/nc_bloaty.c
|
||||
+++ b/networking/nc_bloaty.c
|
||||
@@ -175,9 +175,9 @@ enum {
|
||||
OPT_w = (1 << 5),
|
||||
OPT_l = (1 << 6) * ENABLE_NC_SERVER,
|
||||
OPT_k = (1 << 7) * ENABLE_NC_SERVER,
|
||||
- OPT_i = (1 << (7+2*ENABLE_NC_SERVER)) * ENABLE_NC_EXTRA,
|
||||
- OPT_o = (1 << (8+2*ENABLE_NC_SERVER)) * ENABLE_NC_EXTRA,
|
||||
- OPT_z = (1 << (9+2*ENABLE_NC_SERVER)) * ENABLE_NC_EXTRA,
|
||||
+ OPT_i = (1 << (6+2*ENABLE_NC_SERVER)) * ENABLE_NC_EXTRA,
|
||||
+ OPT_o = (1 << (7+2*ENABLE_NC_SERVER)) * ENABLE_NC_EXTRA,
|
||||
+ OPT_z = (1 << (8+2*ENABLE_NC_SERVER)) * ENABLE_NC_EXTRA,
|
||||
};
|
||||
|
||||
#define o_nflag (option_mask32 & OPT_n)
|
||||
@@ -1,59 +0,0 @@
|
||||
From a9dc7c2f59dc5e92870d2d46316ea5c1f14740e3 Mon Sep 17 00:00:00 2001
|
||||
From: Denys Vlasenko <vda.linux@googlemail.com>
|
||||
Date: Mon, 30 Jun 2014 10:14:34 +0200
|
||||
Subject: [PATCH] lzop: add overflow check
|
||||
|
||||
See CVE-2014-4607
|
||||
http://www.openwall.com/lists/oss-security/2014/06/26/20
|
||||
|
||||
function old new delta
|
||||
lzo1x_decompress_safe 1010 1031 +21
|
||||
|
||||
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
||||
---
|
||||
archival/libarchive/liblzo.h | 2 ++
|
||||
archival/libarchive/lzo1x_d.c | 3 +++
|
||||
2 files changed, 5 insertions(+)
|
||||
|
||||
--- a/archival/libarchive/liblzo.h
|
||||
+++ b/archival/libarchive/liblzo.h
|
||||
@@ -76,11 +76,13 @@
|
||||
# define TEST_IP (ip < ip_end)
|
||||
# define NEED_IP(x) \
|
||||
if ((unsigned)(ip_end - ip) < (unsigned)(x)) goto input_overrun
|
||||
+# define TEST_IV(x) if ((x) > (unsigned)0 - (511)) goto input_overrun
|
||||
|
||||
# undef TEST_OP /* don't need both of the tests here */
|
||||
# define TEST_OP 1
|
||||
# define NEED_OP(x) \
|
||||
if ((unsigned)(op_end - op) < (unsigned)(x)) goto output_overrun
|
||||
+# define TEST_OV(x) if ((x) > (unsigned)0 - (511)) goto output_overrun
|
||||
|
||||
#define HAVE_ANY_OP 1
|
||||
|
||||
--- a/archival/libarchive/lzo1x_d.c
|
||||
+++ b/archival/libarchive/lzo1x_d.c
|
||||
@@ -92,6 +92,7 @@ int lzo1x_decompress_safe(const uint8_t*
|
||||
ip++;
|
||||
NEED_IP(1);
|
||||
}
|
||||
+ TEST_IV(t);
|
||||
t += 15 + *ip++;
|
||||
}
|
||||
/* copy literals */
|
||||
@@ -224,6 +225,7 @@ int lzo1x_decompress_safe(const uint8_t*
|
||||
ip++;
|
||||
NEED_IP(1);
|
||||
}
|
||||
+ TEST_IV(t);
|
||||
t += 31 + *ip++;
|
||||
}
|
||||
#if defined(COPY_DICT)
|
||||
@@ -265,6 +267,7 @@ int lzo1x_decompress_safe(const uint8_t*
|
||||
ip++;
|
||||
NEED_IP(1);
|
||||
}
|
||||
+ TEST_IV(t);
|
||||
t += 7 + *ip++;
|
||||
}
|
||||
#if defined(COPY_DICT)
|
||||
@@ -1,59 +0,0 @@
|
||||
From 28dd64a0e1a9cffcde7799f2849b66c0e16bb9cc Mon Sep 17 00:00:00 2001
|
||||
From: Denys Vlasenko <vda.linux@googlemail.com>
|
||||
Date: Fri, 10 Jan 2014 14:06:57 +0100
|
||||
Subject: [PATCH] libarchive: open_zipped() does not need to check extensions
|
||||
for e.g. gzip
|
||||
|
||||
We only need to check for signature-less extensions,
|
||||
currently only .lzma. The rest can be happily autodetected.
|
||||
|
||||
This fixes "zcat FILE_WITHOUT_GZ_EXT" case, among others.
|
||||
|
||||
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
||||
(cherry picked from commit 7c47b560a8fc97956dd8132bd7f1863d83c19866)
|
||||
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
||||
---
|
||||
archival/libarchive/open_transformer.c | 23 +++++++++++------------
|
||||
1 file changed, 11 insertions(+), 12 deletions(-)
|
||||
|
||||
--- a/archival/libarchive/open_transformer.c
|
||||
+++ b/archival/libarchive/open_transformer.c
|
||||
@@ -182,27 +182,26 @@ int FAST_FUNC setup_unzip_on_fd(int fd,
|
||||
|
||||
int FAST_FUNC open_zipped(const char *fname)
|
||||
{
|
||||
- char *sfx;
|
||||
int fd;
|
||||
|
||||
fd = open(fname, O_RDONLY);
|
||||
if (fd < 0)
|
||||
return fd;
|
||||
|
||||
- sfx = strrchr(fname, '.');
|
||||
- if (sfx) {
|
||||
- sfx++;
|
||||
- if (ENABLE_FEATURE_SEAMLESS_LZMA && strcmp(sfx, "lzma") == 0)
|
||||
- /* .lzma has no header/signature, just trust it */
|
||||
+ if (ENABLE_FEATURE_SEAMLESS_LZMA) {
|
||||
+ /* .lzma has no header/signature, can only detect it by extension */
|
||||
+ char *sfx = strrchr(fname, '.');
|
||||
+ if (sfx && strcmp(sfx+1, "lzma") == 0) {
|
||||
open_transformer_with_sig(fd, unpack_lzma_stream, "unlzma");
|
||||
- else
|
||||
- if ((ENABLE_FEATURE_SEAMLESS_GZ && strcmp(sfx, "gz") == 0)
|
||||
- || (ENABLE_FEATURE_SEAMLESS_BZ2 && strcmp(sfx, "bz2") == 0)
|
||||
- || (ENABLE_FEATURE_SEAMLESS_XZ && strcmp(sfx, "xz") == 0)
|
||||
- ) {
|
||||
- setup_unzip_on_fd(fd, /*fail_if_not_detected:*/ 1);
|
||||
+ return fd;
|
||||
}
|
||||
}
|
||||
+ if ((ENABLE_FEATURE_SEAMLESS_GZ)
|
||||
+ || (ENABLE_FEATURE_SEAMLESS_BZ2)
|
||||
+ || (ENABLE_FEATURE_SEAMLESS_XZ)
|
||||
+ ) {
|
||||
+ setup_unzip_on_fd(fd, /*fail_if_not_detected:*/ 1);
|
||||
+ }
|
||||
|
||||
return fd;
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
--- a/scripts/basic/docproc.c
|
||||
+++ b/scripts/basic/docproc.c
|
||||
@@ -39,7 +39,10 @@
|
||||
#include <limits.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/wait.h>
|
||||
+
|
||||
+#ifndef __FreeBSD__
|
||||
#include <alloca.h>
|
||||
+#endif
|
||||
|
||||
/* exitstatus is used to keep track of any failing calls to kernel-doc,
|
||||
* but execution continues. */
|
||||
--- a/scripts/basic/fixdep.c
|
||||
+++ b/scripts/basic/fixdep.c
|
||||
@@ -113,7 +113,10 @@
|
||||
#include <limits.h>
|
||||
#include <ctype.h>
|
||||
#include <arpa/inet.h>
|
||||
+
|
||||
+#ifndef __FreeBSD__
|
||||
#include <alloca.h>
|
||||
+#endif
|
||||
|
||||
/* bbox: not needed
|
||||
#define INT_CONF ntohl(0x434f4e46)
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/networking/udhcp/dhcpc.c
|
||||
+++ b/networking/udhcp/dhcpc.c
|
||||
@@ -681,6 +681,7 @@ static int bcast_or_ucast(struct dhcp_pa
|
||||
@@ -685,6 +685,7 @@ static int bcast_or_ucast(struct dhcp_pa
|
||||
static NOINLINE int send_discover(uint32_t xid, uint32_t requested)
|
||||
{
|
||||
struct dhcp_packet packet;
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
/* Fill in: op, htype, hlen, cookie, chaddr fields,
|
||||
* random xid field (we override it below),
|
||||
@@ -698,6 +699,7 @@ static NOINLINE int send_discover(uint32
|
||||
@@ -702,6 +703,7 @@ static NOINLINE int send_discover(uint32
|
||||
*/
|
||||
add_client_options(&packet);
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/networking/udhcp/dhcpc.c
|
||||
+++ b/networking/udhcp/dhcpc.c
|
||||
@@ -1400,6 +1400,12 @@ int udhcpc_main(int argc UNUSED_PARAM, c
|
||||
@@ -1410,6 +1410,12 @@ int udhcpc_main(int argc UNUSED_PARAM, c
|
||||
/* silence "uninitialized!" warning */
|
||||
unsigned timestamp_before_wait = timestamp_before_wait;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/networking/udhcp/dhcpc.c
|
||||
+++ b/networking/udhcp/dhcpc.c
|
||||
@@ -1087,7 +1087,6 @@ static void perform_renew(void)
|
||||
@@ -1093,7 +1093,6 @@ static void perform_renew(void)
|
||||
state = RENEW_REQUESTED;
|
||||
break;
|
||||
case RENEW_REQUESTED: /* impatient are we? fine, square 1 */
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
Index: busybox-1.22.1/networking/udhcp/dhcpc.c
|
||||
===================================================================
|
||||
--- busybox-1.22.1.orig/networking/udhcp/dhcpc.c
|
||||
+++ busybox-1.22.1/networking/udhcp/dhcpc.c
|
||||
@@ -659,10 +659,10 @@ static void add_client_options(struct dh
|
||||
--- a/networking/udhcp/dhcpc.c
|
||||
+++ b/networking/udhcp/dhcpc.c
|
||||
@@ -663,10 +663,10 @@ static void add_client_options(struct dh
|
||||
* client reverts to using the IP broadcast address.
|
||||
*/
|
||||
|
||||
@@ -15,7 +13,7 @@ Index: busybox-1.22.1/networking/udhcp/dhcpc.c
|
||||
/*dst*/ INADDR_BROADCAST, SERVER_PORT, MAC_BCAST_ADDR,
|
||||
client_config.ifindex);
|
||||
}
|
||||
@@ -673,7 +673,7 @@ static int bcast_or_ucast(struct dhcp_pa
|
||||
@@ -677,7 +677,7 @@ static int bcast_or_ucast(struct dhcp_pa
|
||||
return udhcp_send_kernel_packet(packet,
|
||||
ciaddr, CLIENT_PORT,
|
||||
server, SERVER_PORT);
|
||||
@@ -24,7 +22,7 @@ Index: busybox-1.22.1/networking/udhcp/dhcpc.c
|
||||
}
|
||||
|
||||
/* Broadcast a DHCP discover packet to the network, with an optionally requested IP */
|
||||
@@ -701,7 +701,7 @@ static NOINLINE int send_discover(uint32
|
||||
@@ -705,7 +705,7 @@ static NOINLINE int send_discover(uint32
|
||||
|
||||
if (msgs++ < 3)
|
||||
bb_info_msg("Sending discover...");
|
||||
@@ -33,7 +31,7 @@ Index: busybox-1.22.1/networking/udhcp/dhcpc.c
|
||||
}
|
||||
|
||||
/* Broadcast a DHCP request message */
|
||||
@@ -745,7 +745,7 @@ static NOINLINE int send_select(uint32_t
|
||||
@@ -749,7 +749,7 @@ static NOINLINE int send_select(uint32_t
|
||||
|
||||
addr.s_addr = requested;
|
||||
bb_info_msg("Sending select for %s...", inet_ntoa(addr));
|
||||
@@ -42,7 +40,7 @@ Index: busybox-1.22.1/networking/udhcp/dhcpc.c
|
||||
}
|
||||
|
||||
/* Unicast or broadcast a DHCP renew message */
|
||||
@@ -813,7 +813,7 @@ static NOINLINE int send_decline(/*uint3
|
||||
@@ -817,7 +817,7 @@ static NOINLINE int send_decline(/*uint3
|
||||
udhcp_add_simple_option(&packet, DHCP_SERVER_ID, server);
|
||||
|
||||
bb_info_msg("Sending decline...");
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/include/applets.src.h
|
||||
+++ b/include/applets.src.h
|
||||
@@ -255,6 +255,7 @@ IF_MT(APPLET(mt, BB_DIR_BIN, BB_SUID_DRO
|
||||
@@ -254,6 +254,7 @@ IF_MT(APPLET(mt, BB_DIR_BIN, BB_SUID_DRO
|
||||
IF_MV(APPLET(mv, BB_DIR_BIN, BB_SUID_DROP))
|
||||
IF_NAMEIF(APPLET(nameif, BB_DIR_SBIN, BB_SUID_DROP))
|
||||
IF_NC(APPLET(nc, BB_DIR_USR_BIN, BB_SUID_DROP))
|
||||
@@ -10,7 +10,7 @@
|
||||
IF_NOHUP(APPLET(nohup, BB_DIR_USR_BIN, BB_SUID_DROP))
|
||||
--- a/networking/Config.src
|
||||
+++ b/networking/Config.src
|
||||
@@ -620,6 +620,12 @@ config FEATURE_IPCALC_LONG_OPTIONS
|
||||
@@ -619,6 +619,12 @@ config FEATURE_IPCALC_LONG_OPTIONS
|
||||
help
|
||||
Support long options for the ipcalc applet.
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/include/applets.src.h
|
||||
+++ b/include/applets.src.h
|
||||
@@ -212,6 +212,7 @@ IF_LN(APPLET_NOEXEC(ln, ln, BB_DIR_BIN,
|
||||
@@ -211,6 +211,7 @@ IF_LN(APPLET_NOEXEC(ln, ln, BB_DIR_BIN,
|
||||
IF_LOAD_POLICY(APPLET(load_policy, BB_DIR_USR_SBIN, BB_SUID_DROP))
|
||||
IF_LOADFONT(APPLET(loadfont, BB_DIR_USR_SBIN, BB_SUID_DROP))
|
||||
IF_LOADKMAP(APPLET(loadkmap, BB_DIR_SBIN, BB_SUID_DROP))
|
||||
@@ -10,7 +10,7 @@
|
||||
IF_LOGIN(APPLET(login, BB_DIR_BIN, BB_SUID_REQUIRE))
|
||||
--- a/miscutils/Config.src
|
||||
+++ b/miscutils/Config.src
|
||||
@@ -419,6 +419,12 @@ config FEATURE_HDPARM_HDIO_GETSET_DMA
|
||||
@@ -385,6 +385,12 @@ config FEATURE_HDPARM_HDIO_GETSET_DMA
|
||||
help
|
||||
Enables the 'hdparm -d' option to get/set using_dma flag.
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
default y
|
||||
--- a/miscutils/Kbuild.src
|
||||
+++ b/miscutils/Kbuild.src
|
||||
@@ -29,6 +29,7 @@ lib-$(CONFIG_INOTIFYD) += inotifyd.o
|
||||
@@ -28,6 +28,7 @@ lib-$(CONFIG_INOTIFYD) += inotifyd.o
|
||||
lib-$(CONFIG_FEATURE_LAST_SMALL)+= last.o
|
||||
lib-$(CONFIG_FEATURE_LAST_FANCY)+= last_fancy.o
|
||||
lib-$(CONFIG_LESS) += less.o
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/networking/ntpd.c
|
||||
+++ b/networking/ntpd.c
|
||||
@@ -238,6 +238,7 @@ typedef struct {
|
||||
@@ -251,6 +251,7 @@ typedef struct {
|
||||
typedef struct {
|
||||
len_and_sockaddr *p_lsa;
|
||||
char *p_dotted;
|
||||
@@ -8,7 +8,7 @@
|
||||
int p_fd;
|
||||
int datapoint_idx;
|
||||
uint32_t lastpkt_refid;
|
||||
@@ -738,8 +739,9 @@ add_peers(char *s)
|
||||
@@ -756,8 +757,9 @@ add_peers(const char *s)
|
||||
peer_t *p;
|
||||
|
||||
p = xzalloc(sizeof(*p));
|
||||
@@ -20,7 +20,7 @@
|
||||
p->p_fd = -1;
|
||||
p->p_xmt_msg.m_status = MODE_CLIENT | (NTP_VERSION << 3);
|
||||
p->next_action_time = G.cur_time; /* = set_next(p, 0); */
|
||||
@@ -788,6 +790,25 @@ send_query_to_peer(peer_t *p)
|
||||
@@ -806,6 +808,25 @@ send_query_to_peer(peer_t *p)
|
||||
*
|
||||
* Uncomment this and use strace to see it in action:
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user