summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHitendra Prajapati <hprajapati@mvista.com>2022-08-17 17:07:25 +0530
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-08-23 15:22:52 +0100
commitb65989b835f45e9a21ab8af0b09194c77d5ab43b (patch)
tree23a11e73a4dbe7a3b8538f07a6e5cfce5b753547
parent33e296554e3088d5dad9088004b0825f30f296c9 (diff)
downloadpoky-b65989b835f45e9a21ab8af0b09194c77d5ab43b.tar.gz
zlib: CVE-2022-37434 a heap-based buffer over-read
Source: https://github.com/madler/zlib MR: 120525 Type: Security Fix Disposition: Backport from https://github.com/madler/zlib/commit/eff308af425b67093bab25f80f1ae950166bece1 & https://github.com/madler/zlib/commit/1eb7682f845ac9e9bf9ae35bbfb3bad5dacbd91d ChangeID: 94d9b7d372b83cc1022c0a15046c5449d39208c3 Description: CVE-2022-37434 zlib: a heap-based buffer over-read or buffer overflow in inflate in inflate.c via a large gzip header extra field. (From OE-Core rev: 46ac4a9dc832edb1b3e75bb4003930085b086bef) Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com> Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-core/zlib/zlib/CVE-2022-37434.patch44
-rw-r--r--meta/recipes-core/zlib/zlib_1.2.11.bb1
2 files changed, 45 insertions, 0 deletions
diff --git a/meta/recipes-core/zlib/zlib/CVE-2022-37434.patch b/meta/recipes-core/zlib/zlib/CVE-2022-37434.patch
new file mode 100644
index 0000000000..d29e6e0f1f
--- /dev/null
+++ b/meta/recipes-core/zlib/zlib/CVE-2022-37434.patch
@@ -0,0 +1,44 @@
1From 8617d83d6939754ae3a04fc2d22daa18eeea2a43 Mon Sep 17 00:00:00 2001
2From: Hitendra Prajapati <hprajapati@mvista.com>
3Date: Wed, 17 Aug 2022 10:15:57 +0530
4Subject: [PATCH] CVE-2022-37434
5
6Upstream-Status: Backport [https://github.com/madler/zlib/commit/eff308af425b67093bab25f80f1ae950166bece1 & https://github.com/madler/zlib/commit/1eb7682f845ac9e9bf9ae35bbfb3bad5dacbd91d]
7CVE: CVE-2022-37434
8Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
9
10Fix a bug when getting a gzip header extra field with inflate().
11
12If the extra field was larger than the space the user provided with
13inflateGetHeader(), and if multiple calls of inflate() delivered
14the extra header data, then there could be a buffer overflow of the
15provided space. This commit assures that provided space is not
16exceeded.
17
18 Fix extra field processing bug that dereferences NULL state->head.
19
20The recent commit to fix a gzip header extra field processing bug
21introduced the new bug fixed here.
22---
23 inflate.c | 5 +++--
24 1 file changed, 3 insertions(+), 2 deletions(-)
25
26diff --git a/inflate.c b/inflate.c
27index ac333e8..cd01857 100644
28--- a/inflate.c
29+++ b/inflate.c
30@@ -759,8 +759,9 @@ int flush;
31 if (copy > have) copy = have;
32 if (copy) {
33 if (state->head != Z_NULL &&
34- state->head->extra != Z_NULL) {
35- len = state->head->extra_len - state->length;
36+ state->head->extra != Z_NULL &&
37+ (len = state->head->extra_len - state->length) <
38+ state->head->extra_max) {
39 zmemcpy(state->head->extra + len, next,
40 len + copy > state->head->extra_max ?
41 state->head->extra_max - len : copy);
42--
432.25.1
44
diff --git a/meta/recipes-core/zlib/zlib_1.2.11.bb b/meta/recipes-core/zlib/zlib_1.2.11.bb
index f8bcc0abcf..f768b41988 100644
--- a/meta/recipes-core/zlib/zlib_1.2.11.bb
+++ b/meta/recipes-core/zlib/zlib_1.2.11.bb
@@ -11,6 +11,7 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/libpng/${BPN}/${PV}/${BPN}-${PV}.tar.xz \
11 file://0001-configure-Pass-LDFLAGS-to-link-tests.patch \ 11 file://0001-configure-Pass-LDFLAGS-to-link-tests.patch \
12 file://CVE-2018-25032.patch \ 12 file://CVE-2018-25032.patch \
13 file://run-ptest \ 13 file://run-ptest \
14 file://CVE-2022-37434.patch \
14 " 15 "
15UPSTREAM_CHECK_URI = "http://zlib.net/" 16UPSTREAM_CHECK_URI = "http://zlib.net/"
16 17