summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/busybox
diff options
context:
space:
mode:
authorMartin Balik <martin.balik@siemens.com>2017-04-05 12:38:57 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-05-18 13:07:33 +0100
commit2de92f27682ba7986677c917969b6b3036080988 (patch)
tree51e109891b6b39934601292e5a5645b254e22934 /meta/recipes-core/busybox
parent094b64ea8b68c640590242a0fb062e587485a0b6 (diff)
downloadpoky-2de92f27682ba7986677c917969b6b3036080988.tar.gz
busybox: Security fix BUG9071
(From OE-Core rev: 3842dc98a471530e23305d09669d7f4bdc05a532) Signed-off-by: Martin Balik <martin.balik@siemens.com> Signed-off-by: Pascal Bach <pascal.bach@siemens.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 0354a9b7adad27b012bcd6bb6cab54dfe0297bcd) Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/busybox')
-rw-r--r--meta/recipes-core/busybox/busybox/BUG9071_buffer_overflow_arp.patch53
-rw-r--r--meta/recipes-core/busybox/busybox_1.24.1.bb1
2 files changed, 54 insertions, 0 deletions
diff --git a/meta/recipes-core/busybox/busybox/BUG9071_buffer_overflow_arp.patch b/meta/recipes-core/busybox/busybox/BUG9071_buffer_overflow_arp.patch
new file mode 100644
index 0000000000..828694cbb9
--- /dev/null
+++ b/meta/recipes-core/busybox/busybox/BUG9071_buffer_overflow_arp.patch
@@ -0,0 +1,53 @@
1busybox1.24.1: Fix busybox - (local) cmdline stack buffer overwrite
2
3[No upstream tracking] -- https://bugs.busybox.net/show_bug.cgi?id=9071
4
5busybox - (local) cmdline stack buffer overwrite
6
7Busybox provides an `arp` applet which is missing an array bounds check for
8command-line parameter `IFNAME`. It is therefore vulnerable to a command-line
9based local stack buffer overwrite effectively allowing local users to write
10past a 16 bytes fixed stack buffer. This leads to two scenarios, one (A) where
11an IOCTL for GET_HW_ADDRESS (`SIOCGIFHWADDR`) fails and results in a corrupted
12`va_list` being passed to `*printf()` and one (B) where an attacker might provide
13valid params for the IOCTL and trick the program to proceed and result in a
14`RET eip overwrite` eventually gaining code execution.
15
16Upstream-Status: Backport [https://git.busybox.net/busybox/commit/networking/arp.c?id=88e2b1cb626761b1924305b761a5dfc723613c4e]
17BUG: BUG9071
18Signed-off-by: Martin Balik <martin.balik@siemens.com>
19Signed-off-by: Pascal Bach <pascal.bach@siemens.com>
20
21--
22
23diff --git a/networking/arp.c b/networking/arp.c
24index 0099aa5..87eb327 100644
25--- a/networking/arp.c
26+++ b/networking/arp.c
27@@ -176,7 +176,7 @@ static int arp_del(char **args)
28 if (flags == 0)
29 flags = 3;
30
31- strncpy(req.arp_dev, device, sizeof(req.arp_dev));
32+ strncpy_IFNAMSIZ(req.arp_dev, device);
33
34 err = -1;
35
36@@ -217,7 +217,7 @@ static void arp_getdevhw(char *ifname, struct sockaddr *sa)
37 struct ifreq ifr;
38 const struct hwtype *xhw;
39
40- strcpy(ifr.ifr_name, ifname);
41+ strncpy_IFNAMSIZ(ifr.ifr_name, ifname);
42 ioctl_or_perror_and_die(sockfd, SIOCGIFHWADDR, &ifr,
43 "can't get HW-Address for '%s'", ifname);
44 if (hw_set && (ifr.ifr_hwaddr.sa_family != hw->type)) {
45@@ -330,7 +330,7 @@ static int arp_set(char **args)
46 /* Fill in the remainder of the request. */
47 req.arp_flags = flags;
48
49- strncpy(req.arp_dev, device, sizeof(req.arp_dev));
50+ strncpy_IFNAMSIZ(req.arp_dev, device);
51
52 /* Call the kernel. */
53 if (option_mask32 & ARP_OPT_v)
diff --git a/meta/recipes-core/busybox/busybox_1.24.1.bb b/meta/recipes-core/busybox/busybox_1.24.1.bb
index cb4568854c..400cdfe28f 100644
--- a/meta/recipes-core/busybox/busybox_1.24.1.bb
+++ b/meta/recipes-core/busybox/busybox_1.24.1.bb
@@ -56,6 +56,7 @@ SRC_URI = "http://www.busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \
56 file://makefile-libbb-race.patch \ 56 file://makefile-libbb-race.patch \
57 file://0001-libiproute-handle-table-ids-larger-than-255.patch \ 57 file://0001-libiproute-handle-table-ids-larger-than-255.patch \
58 file://ifupdown-pass-interface-device-name-for-ipv6-route-c.patch \ 58 file://ifupdown-pass-interface-device-name-for-ipv6-route-c.patch \
59 file://BUG9071_buffer_overflow_arp.patch \
59" 60"
60SRC_URI_append_libc-musl = " file://musl.cfg " 61SRC_URI_append_libc-musl = " file://musl.cfg "
61 62