summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAshish Sharma <asharma@mvista.com>2023-11-07 11:58:36 +0530
committerSteve Sakoman <steve@sakoman.com>2023-11-17 06:00:32 -1000
commit8a8d40420fd1f875f2dfc97ad445335635fd8fd5 (patch)
tree94366e47379b913218c72c011cecb16d7e972314
parenta405e12bebcb5ddea7ac0e2d088ea3f083d9eee1 (diff)
downloadpoky-8a8d40420fd1f875f2dfc97ad445335635fd8fd5.tar.gz
zlib: Backport fix for CVE-2023-45853
Upstream-Status: Backport from [https://github.com/madler/zlib/commit/73331a6a0481067628f065ffe87bb1d8f787d10c] (From OE-Core rev: bbe5e13c2ff981d7defd14f9e2d91ebbe107bb4b) Signed-off-by: Ashish Sharma <asharma@mvista.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
-rw-r--r--meta/recipes-core/zlib/zlib/CVE-2023-45853.patch40
-rw-r--r--meta/recipes-core/zlib/zlib_1.2.11.bb1
2 files changed, 41 insertions, 0 deletions
diff --git a/meta/recipes-core/zlib/zlib/CVE-2023-45853.patch b/meta/recipes-core/zlib/zlib/CVE-2023-45853.patch
new file mode 100644
index 0000000000..654579eb81
--- /dev/null
+++ b/meta/recipes-core/zlib/zlib/CVE-2023-45853.patch
@@ -0,0 +1,40 @@
1From 73331a6a0481067628f065ffe87bb1d8f787d10c Mon Sep 17 00:00:00 2001
2From: Hans Wennborg <hans@chromium.org>
3Date: Fri, 18 Aug 2023 11:05:33 +0200
4Subject: [PATCH] Reject overflows of zip header fields in minizip.
5
6This checks the lengths of the file name, extra field, and comment
7that would be put in the zip headers, and rejects them if they are
8too long. They are each limited to 65535 bytes in length by the zip
9format. This also avoids possible buffer overflows if the provided
10fields are too long.
11
12Upstream-Status: Backport from [https://github.com/madler/zlib/commit/73331a6a0481067628f065ffe87bb1d8f787d10c]
13CVE: CVE-2023-45853
14Signed-off-by: Ashish Sharma <asharma@mvista.com>
15---
16 contrib/minizip/zip.c | 11 +++++++++++
17 1 file changed, 11 insertions(+)
18
19diff --git a/contrib/minizip/zip.c b/contrib/minizip/zip.c
20index 3d3d4cadd..0446109b2 100644
21--- a/contrib/minizip/zip.c
22+++ b/contrib/minizip/zip.c
23@@ -1043,6 +1043,17 @@ extern int ZEXPORT zipOpenNewFileInZip4_64(zipFile file, const char* filename, c
24 return ZIP_PARAMERROR;
25 #endif
26
27+ // The filename and comment length must fit in 16 bits.
28+ if ((filename!=NULL) && (strlen(filename)>0xffff))
29+ return ZIP_PARAMERROR;
30+ if ((comment!=NULL) && (strlen(comment)>0xffff))
31+ return ZIP_PARAMERROR;
32+ // The extra field length must fit in 16 bits. If the member also requires
33+ // a Zip64 extra block, that will also need to fit within that 16-bit
34+ // length, but that will be checked for later.
35+ if ((size_extrafield_local>0xffff) || (size_extrafield_global>0xffff))
36+ return ZIP_PARAMERROR;
37+
38 zi = (zip64_internal*)file;
39
40 if (zi->in_opened_file_inzip == 1)
diff --git a/meta/recipes-core/zlib/zlib_1.2.11.bb b/meta/recipes-core/zlib/zlib_1.2.11.bb
index e2fbc12bd8..910fc2ec17 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://CVE-2018-25032.patch \ 11 file://CVE-2018-25032.patch \
12 file://run-ptest \ 12 file://run-ptest \
13 file://CVE-2022-37434.patch \ 13 file://CVE-2022-37434.patch \
14 file://CVE-2023-45853.patch \
14 " 15 "
15UPSTREAM_CHECK_URI = "http://zlib.net/" 16UPSTREAM_CHECK_URI = "http://zlib.net/"
16 17