zlib: patch CVE-2026-85091
PATCH v2 1/1 zlib: patch CVE-2026-85091
From: Peter Marko <[email protected]>
Pick path per [1].
[1] https://security-tracker.debian.org/tracker/CVE-2026-85091
Signed-off-by Peter Marko <[email protected]>
--- .../zlib/zlib/CVE-2026-85091.patch | 31 +++++++++++++++++++ meta/recipes-core/zlib/zlib_1.3.2.bb | 1 + 2 files changed, 32 insertions(+) create mode 100644 meta/recipes-core/zlib/zlib/CVE-2026-85091.patch
meta/recipes-core/zlib/zlib/CVE-2026-85091.patch new file +31 -0
@@ -0,0 +1,31 @@ +From df84af25dc1942490e1d1c899a07619152a46148 Mon Sep 17 00:00:00 2001 +From: Mark Adler <[email protected]> +Date: Wed, 16 Sep 2026 16:26:14 -0700 +Subject: [PATCH] Fix buffer overflow bug in non-blocking gzwrite. + +This addresses CVE-2026-85091. + +CVE: CVE-2026-85091 +Upstream-Status: Backport [https://github.com/madler/zlib/commit/df84af25dc1942490e1d1c899a07619152a46148] +Signed-off-by: Peter Marko <[email protected]> +--- + gzwrite.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/gzwrite.c b/gzwrite.c +index b217b85..5123292 100644 +--- a/gzwrite.c ++++ b/gzwrite.c +@@ -242,8 +242,11 @@ local z_size_t gz_write(gz_statep state, voidpc buf, z_size_t len) { + n -= state->strm.avail_in; + state->x.pos += n; + len -= n; +- if (ret == -1) ++ if (ret == -1) { ++ state->strm.avail_in = 0; ++ state->strm.next_in = state->in; + return state->again ? put - len : 0; ++ } + } while (len); + } +
meta/recipes-core/zlib/zlib_1.3.2.bb +1 -0
@@ -9,6 +9,7 @@ LIC_FILES_CHKSUM = "file://zlib.h;beginline=6;endline=23;md5=5377232268e952e9ef6 # The source tarball needs to be .gz as only the .gz ends up in fossils/ SRC_URI = "https://zlib.net/${BP}.tar.gz \ file://run-ptest \ + file://CVE-2026-85091.patch \ " UPSTREAM_CHECK_URI = "http://zlib.net/"