From 8f111c0bd86464f613e075e14160001e0614d073 Mon Sep 17 00:00:00 2001 From: Rmys Date: Fri, 17 Nov 2023 14:13:07 +0300 Subject: [PATCH] zlib ver. bump --- system/base/zlib/files/05796d3d8d55.patch | 24 --------- ...0ddad3091574a0c2e3b5a66a8fee9a7ab212f.diff | 21 -------- system/base/zlib/files/ec3df00224d4.patch | 51 ------------------- .../files/zlib-1.2.13-CVE-2023-45853.patch | 36 +++++++++++++ system/base/zlib/pspec.xml | 14 +++-- 5 files changed, 45 insertions(+), 101 deletions(-) delete mode 100644 system/base/zlib/files/05796d3d8d55.patch delete mode 100644 system/base/zlib/files/e490ddad3091574a0c2e3b5a66a8fee9a7ab212f.diff delete mode 100644 system/base/zlib/files/ec3df00224d4.patch create mode 100644 system/base/zlib/files/zlib-1.2.13-CVE-2023-45853.patch diff --git a/system/base/zlib/files/05796d3d8d55.patch b/system/base/zlib/files/05796d3d8d55.patch deleted file mode 100644 index 0136071e..00000000 --- a/system/base/zlib/files/05796d3d8d55.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 05796d3d8d5546cf1b4dfe2cd72ab746afae505d Mon Sep 17 00:00:00 2001 -From: Mark Adler -Date: Mon, 28 Mar 2022 18:34:10 -0700 -Subject: [PATCH] Fix configure issue that discarded provided CC definition. - ---- - configure | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/configure b/configure -index 52ff4a04e..3fa3e8618 100755 ---- a/configure -+++ b/configure -@@ -174,7 +174,10 @@ if test -z "$CC"; then - else - cc=${CROSS_PREFIX}cc - fi -+else -+ cc=${CC} - fi -+ - cflags=${CFLAGS-"-O3"} - # to force the asm version use: CFLAGS="-O3 -DASMV" ./configure - case "$cc" in diff --git a/system/base/zlib/files/e490ddad3091574a0c2e3b5a66a8fee9a7ab212f.diff b/system/base/zlib/files/e490ddad3091574a0c2e3b5a66a8fee9a7ab212f.diff deleted file mode 100644 index 489809a9..00000000 --- a/system/base/zlib/files/e490ddad3091574a0c2e3b5a66a8fee9a7ab212f.diff +++ /dev/null @@ -1,21 +0,0 @@ -diff --git a/contrib/minizip/Makefile.am b/contrib/minizip/Makefile.am -index d343011eb..4f4661023 100644 ---- a/contrib/minizip/Makefile.am -+++ b/contrib/minizip/Makefile.am -@@ -26,13 +26,15 @@ libminizip_la_LDFLAGS = $(AM_LDFLAGS) -version-info 1:0:0 -lz - - minizip_includedir = $(includedir)/minizip - minizip_include_HEADERS = \ -- crypt.h \ - ioapi.h \ - mztools.h \ - unzip.h \ - zip.h \ - ${iowin32_h} - -+noinst_HEADERS = \ -+ crypt.h -+ - pkgconfigdir = $(libdir)/pkgconfig - pkgconfig_DATA = minizip.pc - diff --git a/system/base/zlib/files/ec3df00224d4.patch b/system/base/zlib/files/ec3df00224d4.patch deleted file mode 100644 index 85a6a7e3..00000000 --- a/system/base/zlib/files/ec3df00224d4.patch +++ /dev/null @@ -1,51 +0,0 @@ -From ec3df00224d4b396e2ac6586ab5d25f673caa4c2 Mon Sep 17 00:00:00 2001 -From: Mark Adler -Date: Wed, 30 Mar 2022 11:14:53 -0700 -Subject: [PATCH] Correct incorrect inputs provided to the CRC functions. - -The previous releases of zlib were not sensitive to incorrect CRC -inputs with bits set above the low 32. This commit restores that -behavior, so that applications with such bugs will continue to -operate as before. ---- - crc32.c | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/crc32.c b/crc32.c -index a1bdce5c2..451887bc7 100644 ---- a/crc32.c -+++ b/crc32.c -@@ -630,7 +630,7 @@ unsigned long ZEXPORT crc32_z(crc, buf, len) - #endif /* DYNAMIC_CRC_TABLE */ - - /* Pre-condition the CRC */ -- crc ^= 0xffffffff; -+ crc = (~crc) & 0xffffffff; - - /* Compute the CRC up to a word boundary. */ - while (len && ((z_size_t)buf & 7) != 0) { -@@ -749,7 +749,7 @@ unsigned long ZEXPORT crc32_z(crc, buf, len) - #endif /* DYNAMIC_CRC_TABLE */ - - /* Pre-condition the CRC */ -- crc ^= 0xffffffff; -+ crc = (~crc) & 0xffffffff; - - #ifdef W - -@@ -1077,7 +1077,7 @@ uLong ZEXPORT crc32_combine64(crc1, crc2, len2) - #ifdef DYNAMIC_CRC_TABLE - once(&made, make_crc_table); - #endif /* DYNAMIC_CRC_TABLE */ -- return multmodp(x2nmodp(len2, 3), crc1) ^ crc2; -+ return multmodp(x2nmodp(len2, 3), crc1) ^ (crc2 & 0xffffffff); - } - - /* ========================================================================= */ -@@ -1112,5 +1112,5 @@ uLong crc32_combine_op(crc1, crc2, op) - uLong crc2; - uLong op; - { -- return multmodp(op, crc1) ^ crc2; -+ return multmodp(op, crc1) ^ (crc2 & 0xffffffff); - } diff --git a/system/base/zlib/files/zlib-1.2.13-CVE-2023-45853.patch b/system/base/zlib/files/zlib-1.2.13-CVE-2023-45853.patch new file mode 100644 index 00000000..28318970 --- /dev/null +++ b/system/base/zlib/files/zlib-1.2.13-CVE-2023-45853.patch @@ -0,0 +1,36 @@ +From 73331a6a0481067628f065ffe87bb1d8f787d10c Mon Sep 17 00:00:00 2001 +From: Hans Wennborg +Date: Fri, 18 Aug 2023 11:05:33 +0200 +Subject: [PATCH] Reject overflows of zip header fields in minizip. + +This checks the lengths of the file name, extra field, and comment +that would be put in the zip headers, and rejects them if they are +too long. They are each limited to 65535 bytes in length by the zip +format. This also avoids possible buffer overflows if the provided +fields are too long. +--- + contrib/minizip/zip.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/contrib/minizip/zip.c b/contrib/minizip/zip.c +index 3d3d4cadd..0446109b2 100644 +--- a/contrib/minizip/zip.c ++++ b/contrib/minizip/zip.c +@@ -1043,6 +1043,17 @@ extern int ZEXPORT zipOpenNewFileInZip4_64(zipFile file, const char* filename, c + return ZIP_PARAMERROR; + #endif + ++ // The filename and comment length must fit in 16 bits. ++ if ((filename!=NULL) && (strlen(filename)>0xffff)) ++ return ZIP_PARAMERROR; ++ if ((comment!=NULL) && (strlen(comment)>0xffff)) ++ return ZIP_PARAMERROR; ++ // The extra field length must fit in 16 bits. If the member also requires ++ // a Zip64 extra block, that will also need to fit within that 16-bit ++ // length, but that will be checked for later. ++ if ((size_extrafield_local>0xffff) || (size_extrafield_global>0xffff)) ++ return ZIP_PARAMERROR; ++ + zi = (zip64_internal*)file; + + if (zi->in_opened_file_inzip == 1) diff --git a/system/base/zlib/pspec.xml b/system/base/zlib/pspec.xml index d0545c04..13b9d833 100644 --- a/system/base/zlib/pspec.xml +++ b/system/base/zlib/pspec.xml @@ -12,13 +12,10 @@ library Standard (de)compression library Zlib is a general-purpose, patent-free, lossless data compression library which is used by many different programs. - https://github.com/madler/zlib/archive/refs/tags/v1.2.13.tar.gz + https://github.com/madler/zlib/archive/refs/tags/v1.3.tar.gz - dont-call-ldconfig.patch - - - e490ddad3091574a0c2e3b5a66a8fee9a7ab212f.diff + zlib-1.2.13-CVE-2023-45853.patch @@ -93,6 +90,13 @@ + + 2023-11-17 + 1.3 + Version bump. + Mustafa Cinasal + muscnsl@gmail.com + 2023-07-13 1.2.13