summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/busybox
diff options
context:
space:
mode:
authorzhengruoqin <zhengrq.fnst@fujitsu.com>2021-05-10 10:53:06 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-05-11 11:54:26 +0100
commitc8ea2cb37dca7bb67faceb72dab6eb9ad98bdf87 (patch)
treef2674787dc1771d2bd34842e0fd5b9022fe971ab /meta/recipes-core/busybox
parent764db5fde8c7677772530dfe7488da54e446e2b4 (diff)
downloadpoky-c8ea2cb37dca7bb67faceb72dab6eb9ad98bdf87.tar.gz
busybox: upgrade 1.33.0 -> 1.33.1
0001-decompress_gunzip-Fix-DoS-if-gzip-is-corrupt.patch removed since it is included in 1.33.1 (From OE-Core rev: 544236b12a72ee5be5ef0147249ead112082b871) Signed-off-by: Zheng Ruoqin <zhengrq.fnst@cn.fujitsu.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/0001-decompress_gunzip-Fix-DoS-if-gzip-is-corrupt.patch58
-rw-r--r--meta/recipes-core/busybox/busybox_1.33.1.bb (renamed from meta/recipes-core/busybox/busybox_1.33.0.bb)3
2 files changed, 1 insertions, 60 deletions
diff --git a/meta/recipes-core/busybox/busybox/0001-decompress_gunzip-Fix-DoS-if-gzip-is-corrupt.patch b/meta/recipes-core/busybox/busybox/0001-decompress_gunzip-Fix-DoS-if-gzip-is-corrupt.patch
deleted file mode 100644
index 67c9f189cc..0000000000
--- a/meta/recipes-core/busybox/busybox/0001-decompress_gunzip-Fix-DoS-if-gzip-is-corrupt.patch
+++ /dev/null
@@ -1,58 +0,0 @@
1From fe791386ebc270219ca00406c9fdadc5130b64ee Mon Sep 17 00:00:00 2001
2From: Samuel Sapalski <samuel.sapalski@nokia.com>
3Date: Wed, 3 Mar 2021 16:31:22 +0100
4Subject: [PATCH] decompress_gunzip: Fix DoS if gzip is corrupt
5
6On certain corrupt gzip files, huft_build will set the error bit on
7the result pointer. If afterwards abort_unzip is called huft_free
8might run into a segmentation fault or an invalid pointer to
9free(p).
10
11In order to mitigate this, we check in huft_free if the error bit
12is set and clear it before the linked list is freed.
13
14Signed-off-by: Samuel Sapalski <samuel.sapalski@nokia.com>
15Signed-off-by: Peter Kaestle <peter.kaestle@nokia.com>
16Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
17
18Upstream-Status: Backport
19CVE: CVE-2021-28831
20Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
21---
22 archival/libarchive/decompress_gunzip.c | 12 ++++++++++--
23 1 file changed, 10 insertions(+), 2 deletions(-)
24
25diff --git a/archival/libarchive/decompress_gunzip.c b/archival/libarchive/decompress_gunzip.c
26index eb3b64930..e93cd5005 100644
27--- a/archival/libarchive/decompress_gunzip.c
28+++ b/archival/libarchive/decompress_gunzip.c
29@@ -220,10 +220,20 @@ static const uint8_t border[] ALIGN1 = {
30 * each table.
31 * t: table to free
32 */
33+#define BAD_HUFT(p) ((uintptr_t)(p) & 1)
34+#define ERR_RET ((huft_t*)(uintptr_t)1)
35 static void huft_free(huft_t *p)
36 {
37 huft_t *q;
38
39+ /*
40+ * If 'p' has the error bit set we have to clear it, otherwise we might run
41+ * into a segmentation fault or an invalid pointer to free(p)
42+ */
43+ if (BAD_HUFT(p)) {
44+ p = (huft_t*)((uintptr_t)(p) ^ (uintptr_t)(ERR_RET));
45+ }
46+
47 /* Go through linked list, freeing from the malloced (t[-1]) address. */
48 while (p) {
49 q = (--p)->v.t;
50@@ -289,8 +299,6 @@ static unsigned fill_bitbuffer(STATE_PARAM unsigned bitbuffer, unsigned *current
51 * or a valid pointer to a Huffman table, ORed with 0x1 if incompete table
52 * is given: "fixed inflate" decoder feeds us such data.
53 */
54-#define BAD_HUFT(p) ((uintptr_t)(p) & 1)
55-#define ERR_RET ((huft_t*)(uintptr_t)1)
56 static huft_t* huft_build(const unsigned *b, const unsigned n,
57 const unsigned s, const struct cp_ext *cp_ext,
58 unsigned *m)
diff --git a/meta/recipes-core/busybox/busybox_1.33.0.bb b/meta/recipes-core/busybox/busybox_1.33.1.bb
index c334c42000..a71ff530cb 100644
--- a/meta/recipes-core/busybox/busybox_1.33.0.bb
+++ b/meta/recipes-core/busybox/busybox_1.33.1.bb
@@ -47,9 +47,8 @@ SRC_URI = "https://busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \
47 file://0001-sysctl-ignore-EIO-of-stable_secret-below-proc-sys-ne.patch \ 47 file://0001-sysctl-ignore-EIO-of-stable_secret-below-proc-sys-ne.patch \
48 file://rev.cfg \ 48 file://rev.cfg \
49 file://pgrep.cfg \ 49 file://pgrep.cfg \
50 file://0001-decompress_gunzip-Fix-DoS-if-gzip-is-corrupt.patch \
51 file://0001-gen_build_files-Use-C-locale-when-calling-sed-on-glo.patch \ 50 file://0001-gen_build_files-Use-C-locale-when-calling-sed-on-glo.patch \
52 " 51 "
53SRC_URI_append_libc-musl = " file://musl.cfg " 52SRC_URI_append_libc-musl = " file://musl.cfg "
54 53
55SRC_URI[tarball.sha256sum] = "d568681c91a85edc6710770cebc1e80e042ad74d305b5c2e6d57a5f3de3b8fbd" 54SRC_URI[tarball.sha256sum] = "12cec6bd2b16d8a9446dd16130f2b92982f1819f6e1c5f5887b6db03f5660d28"