summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSana Kazi <Sana.Kazi@kpit.com>2020-02-04 07:06:05 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-02-04 18:43:08 +0000
commit175e6cb75ce328d51a9d4ad18c7e09d9fb92c2e1 (patch)
treee35565d197d31e5d629ce29167f66da789308730
parente547b2c85ff9e89b54bc1f97f91da46bd76ed0d2 (diff)
downloadpoky-175e6cb75ce328d51a9d4ad18c7e09d9fb92c2e1.tar.gz
bzip2: Fix CVE-2019-12900
Added patch for CVE-2019-12900 as backport from upstream. Fixes out of bound access discovered while fuzzying karchive. Tested by: Sana.Kazi@kpit.com (From OE-Core rev: aec10c9993f04304466e15ea7a5bc4d85a357c5b) Signed-off-by: Saloni Jain <Saloni.Jain@kpit.com> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-extended/bzip2/bzip2-1.0.6/CVE-2019-12900.patch36
1 files changed, 36 insertions, 0 deletions
diff --git a/meta/recipes-extended/bzip2/bzip2-1.0.6/CVE-2019-12900.patch b/meta/recipes-extended/bzip2/bzip2-1.0.6/CVE-2019-12900.patch
new file mode 100644
index 0000000000..9859d9d1a2
--- /dev/null
+++ b/meta/recipes-extended/bzip2/bzip2-1.0.6/CVE-2019-12900.patch
@@ -0,0 +1,36 @@
1From 74de1e2e6ffc9d51ef9824db71a8ffee5962cdbc Mon Sep 17 00:00:00 2001
2From: Albert Astals Cid <aacid@kde.org>
3Date: Tue, 28 May 2019 19:35:18 +0200
4Subject: [PATCH] Make sure nSelectors is not out of range
5
6nSelectors is used in a loop from 0 to nSelectors to access selectorMtf
7which is
8UChar selectorMtf[BZ_MAX_SELECTORS];
9so if nSelectors is bigger than BZ_MAX_SELECTORS it'll do an invalid memory
10access
11Fixes out of bounds access discovered while fuzzying karchive
12
13Link: https://gitlab.com/federicomenaquintero/bzip2/commit/74de1e2e6ffc9d51ef9824db71a8ffee5962cdbc.patch
14
15Upstream-Status: Backport
16CVE: CVE-2019-12900.patch
17Signed-off-by: Saloni Jain <Saloni.Jain@kpit.com>
18---
19 decompress.c | 2 +-
20 1 file changed, 1 insertion(+), 1 deletion(-)
21
22diff --git a/decompress.c b/decompress.c
23index ab6a624..f3db91d 100644
24--- a/decompress.c
25+++ b/decompress.c
26@@ -287,7 +287,7 @@ Int32 BZ2_decompress ( DState* s )
27 GET_BITS(BZ_X_SELECTOR_1, nGroups, 3);
28 if (nGroups < 2 || nGroups > 6) RETURN(BZ_DATA_ERROR);
29 GET_BITS(BZ_X_SELECTOR_2, nSelectors, 15);
30- if (nSelectors < 1) RETURN(BZ_DATA_ERROR);
31+ if (nSelectors < 1 || nSelectors > BZ_MAX_SELECTORS) RETURN(BZ_DATA_ERROR);
32 for (i = 0; i < nSelectors; i++) {
33 j = 0;
34 while (True) {
35--
362.22.0