diff options
| author | Pavel Zhukov <pavel.zhukov@huawei.com> | 2021-12-01 10:54:36 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-12-08 20:28:01 +0000 |
| commit | 1f2cf291e767f2472d95ccee19c4d97bdc00f3d6 (patch) | |
| tree | 9b1636689def0f324481d66f3ea4505fc8d73b00 | |
| parent | 090075eb3a7499d350dbd3ccd4c45711bd37ddba (diff) | |
| download | poky-1f2cf291e767f2472d95ccee19c4d97bdc00f3d6.tar.gz | |
busybox: Fix for CVE-2021-42374
An out-of-bounds heap read in unlzma leads to information leak and
denial of service when crafted LZMA-compressed input is decompressed.
This can be triggered by any applet/format that internally supports
LZMA compression.
Reference: https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2021-42374
(From OE-Core rev: 297719989ebe8ce7d50e3991cba3e268938690ce)
Signed-off-by: Pavel Zhukov <pavel.zhukov@huawei.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/recipes-core/busybox/busybox/CVE-2021-42374.patch | 53 | ||||
| -rw-r--r-- | meta/recipes-core/busybox/busybox_1.31.1.bb | 1 |
2 files changed, 54 insertions, 0 deletions
diff --git a/meta/recipes-core/busybox/busybox/CVE-2021-42374.patch b/meta/recipes-core/busybox/busybox/CVE-2021-42374.patch new file mode 100644 index 0000000000..aef8a3db85 --- /dev/null +++ b/meta/recipes-core/busybox/busybox/CVE-2021-42374.patch | |||
| @@ -0,0 +1,53 @@ | |||
| 1 | From 04f052c56ded5ab6a904e3a264a73dc0412b2e78 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Denys Vlasenko <vda.linux@googlemail.com> | ||
| 3 | Date: Tue, 15 Jun 2021 15:07:57 +0200 | ||
| 4 | Subject: [PATCH] unlzma: fix a case where we could read before beginning of | ||
| 5 | buffer | ||
| 6 | Cc: pavel@zhukoff.net | ||
| 7 | |||
| 8 | Testcase: | ||
| 9 | |||
| 10 | 21 01 01 00 00 00 00 00 e7 01 01 01 ef 00 df b6 | ||
| 11 | 00 17 02 10 11 0f ff 00 16 00 00 | ||
| 12 | |||
| 13 | Unfortunately, the bug is not reliably causing a segfault, | ||
| 14 | the behavior depends on what's in memory before the buffer. | ||
| 15 | |||
| 16 | function old new delta | ||
| 17 | unpack_lzma_stream 2762 2768 +6 | ||
| 18 | |||
| 19 | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com> | ||
| 20 | |||
| 21 | Signed-off-by: Pavel Zhukov <pavel.zhukov@huawei.com> | ||
| 22 | |||
| 23 | CVE: CVE-2021-42374 | ||
| 24 | Upstream-Status: Backport [https://git.busybox.net/busybox/commit/?h=1_33_stable&id=d326be2850ea2bd78fe2c22d6c45c3b861d82937] | ||
| 25 | Comment: testdata dropped because of binary format | ||
| 26 | |||
| 27 | --- | ||
| 28 | archival/libarchive/decompress_unlzma.c | 5 ++++- | ||
| 29 | testsuite/unlzma.tests | 17 +++++++++++++---- | ||
| 30 | testsuite/unlzma_issue_3.lzma | Bin 0 -> 27 bytes | ||
| 31 | 3 files changed, 17 insertions(+), 5 deletions(-) | ||
| 32 | create mode 100644 testsuite/unlzma_issue_3.lzma | ||
| 33 | |||
| 34 | diff --git a/archival/libarchive/decompress_unlzma.c b/archival/libarchive/decompress_unlzma.c | ||
| 35 | index 0744f231a1d64d92676b0cada2342f88f3b39b31..fb5aac8fe9ea0c53e0c2d7a7cbd05a753e39bc9d 100644 | ||
| 36 | --- a/archival/libarchive/decompress_unlzma.c | ||
| 37 | +++ b/archival/libarchive/decompress_unlzma.c | ||
| 38 | @@ -290,8 +290,11 @@ unpack_lzma_stream(transformer_state_t *xstate) | ||
| 39 | uint32_t pos; | ||
| 40 | |||
| 41 | pos = buffer_pos - rep0; | ||
| 42 | - if ((int32_t)pos < 0) | ||
| 43 | + if ((int32_t)pos < 0) { | ||
| 44 | pos += header.dict_size; | ||
| 45 | + if ((int32_t)pos < 0) | ||
| 46 | + goto bad; | ||
| 47 | + } | ||
| 48 | match_byte = buffer[pos]; | ||
| 49 | do { | ||
| 50 | int bit; | ||
| 51 | -- | ||
| 52 | 2.34.0 | ||
| 53 | |||
diff --git a/meta/recipes-core/busybox/busybox_1.31.1.bb b/meta/recipes-core/busybox/busybox_1.31.1.bb index d9d5f4f96b..55c00eb483 100644 --- a/meta/recipes-core/busybox/busybox_1.31.1.bb +++ b/meta/recipes-core/busybox/busybox_1.31.1.bb | |||
| @@ -52,6 +52,7 @@ SRC_URI = "https://busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \ | |||
| 52 | file://0001-hwclock-make-glibc-2.31-compatible.patch \ | 52 | file://0001-hwclock-make-glibc-2.31-compatible.patch \ |
| 53 | file://0001-decompress_gunzip-Fix-DoS-if-gzip-is-corrupt.patch \ | 53 | file://0001-decompress_gunzip-Fix-DoS-if-gzip-is-corrupt.patch \ |
| 54 | file://0001-mktemp-add-tmpdir-option.patch \ | 54 | file://0001-mktemp-add-tmpdir-option.patch \ |
| 55 | file://CVE-2021-42374.patch \ | ||
| 55 | " | 56 | " |
| 56 | SRC_URI_append_libc-musl = " file://musl.cfg " | 57 | SRC_URI_append_libc-musl = " file://musl.cfg " |
| 57 | 58 | ||
