From patchwork Wed Dec 2 10:31:42 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Joao Marcos Costa X-Patchwork-Id: 106949 X-Patchwork-Delegate: yoann.congal@smile.fr Received: from smtpout-03.galae.net (smtpout-03.galae.net [185.246.85.4]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.33345.1796207663680826160 for ; Wed, 02 Dec 2026 02:34:24 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@bootlin.com header.s=dkim header.b=ANTIqYZZ; spf=pass (domain: bootlin.com, ip: 185.246.85.4, mailfrom: joaomarcos.costa@bootlin.com) Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id 331834E417A6; Wed, 2 Dec 2026 10:34:21 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 02ABB6075F; Wed, 2 Dec 2026 10:34:21 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id CEC5111EA26B0; Wed, 02 Dec 2026 11:34:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1796207660; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding; bh=4qwXhwbnrhn8lSXPvzSqhCw0GqNXvhSB3FTdi1DjEQI=; b=ANTIqYZZkd4G/9ZOgxB2uf9jMVX5DBGXFcBpB4E04G6O6WQY1jRQJT9PzZ3RVoZZ63xhmU Dgm/p1222Fab/TSGtAXapQByRDPbOFOCYuiR3DkquMJvEGMw8J1JRGheMLR8SAUp34YA/T begP7H4AeSsLvF0x55LAdS9Sh5Z1nBnMoi2qa1a2kiGVs2kOYrVnnkAeWhFkVkx0LfToy8 2+CbcsReqPjyDygfPMd7dlQKKHj1nxSgexmew3GjU5jcuJtOk+VFEYzSA67EQKKw0KnJDT NWMs0QU+EN0sDdbCnBZa1I7Lmyd6xoPO1utf4rZRQhxzYzthug1L7UHUKr3vkw== From: =?utf-8?q?Jo=C3=A3o_Marcos_Costa_=28Schneider_Electric=29?= To: openembedded-core@lists.openembedded.org Cc: thomas.petazzoni@bootlin.com, yoann.congal@smile.fr, =?utf-8?q?Jo=C3=A3o?= =?utf-8?q?_Marcos_Costa_=28Schneider_Electric=29?= Subject: [PATCH] zlib: fix CVE-2026-85091 Date: Wed, 2 Dec 2026 11:31:42 +0100 Message-ID: <20261202103142.1493980-1-joaomarcos.costa@bootlin.com> X-Mailer: git-send-email 2.55.0 MIME-Version: 1.0 X-Last-TLS-Session-Version: TLSv1.3 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by lin-tor-korg-lkml-alma10-1 with HTTPS for ; Wed, 02 Dec 2026 10:34:31 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/251808 This vulnerability, marked as High [1], was fixed upstream [2] since v1.4. Backport the fix to zlib v1.3.1. This was tested with the poc [3] mentioned in Debian's Security tracker [4], which doesn't produce any heap-buffer-overflow errors. For reference, this is the output of 'poc' without the fix: ==1190853==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x7f0496071800 at pc 0x7f04972b741d bp 0x7ffd3392d3b0 sp 0x7ffd3392cb70 WRITE of size 2 at 0x7f0496071800 thread T0 #0 0x7f04972b741c in vsnprintf (/lib64/libasan.so.8+0xb741c) (BuildId: fd074f20195c3dc106c8f366d4cbad1efb955954) #1 0x000000410b23 in gzvprintf (...)/build/workspace/sources/zlib/gzwrite.c:407 #2 0x00000041149a in gzprintf (...)/build/workspace/sources/zlib/gzwrite.c:435 #3 0x000000400e20 in main (...)/build/workspace/sources/zlib/poc.c:44 [1] https://nvd.nist.gov/vuln/detail/CVE-2026-85091 [2] https://github.com/madler/zlib/commit/df84af25dc1942490e1d1c899a07619152a46148 [3] https://gist.github.com/thesmartshadow/e0b9481792afb7c31e86fee1ff084490 [4] https://security-tracker.debian.org/tracker/CVE-2026-85091 Signed-off-by: João Marcos Costa (Schneider Electric) --- .../zlib/zlib/CVE-2026-85091.patch | 35 +++++++++++++++++++ meta/recipes-core/zlib/zlib_1.3.1.bb | 1 + 2 files changed, 36 insertions(+) create mode 100644 meta/recipes-core/zlib/zlib/CVE-2026-85091.patch diff --git a/meta/recipes-core/zlib/zlib/CVE-2026-85091.patch b/meta/recipes-core/zlib/zlib/CVE-2026-85091.patch new file mode 100644 index 0000000000..896971683c --- /dev/null +++ b/meta/recipes-core/zlib/zlib/CVE-2026-85091.patch @@ -0,0 +1,35 @@ +From b75b8c6be592a4e16f2b8dbdb11e79e448ab85a3 Mon Sep 17 00:00:00 2001 +From: Mark Adler +Date: Wed, 16 Sep 2026 16:26:14 -0700 +Subject: [PATCH] Fix buffer overflow bug in non-blocking gzwrite. +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This addresses CVE-2026-85091. + +CVE: CVE-2026-85091 +Upstream-Status: Backport [https://github.com/madler/zlib/commit/df84af25dc1942490e1d1c899a07619152a46148] + +Signed-off-by: João Marcos Costa +--- + gzwrite.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/gzwrite.c b/gzwrite.c +index 435b462..fd340f0 100644 +--- a/gzwrite.c ++++ b/gzwrite.c +@@ -223,8 +223,11 @@ local z_size_t gz_write(gz_statep state, voidpc buf, z_size_t len) { + n = (unsigned)len; + state->strm.avail_in = n; + state->x.pos += n; +- if (gz_comp(state, Z_NO_FLUSH) == -1) ++ if (gz_comp(state, Z_NO_FLUSH) == -1) { ++ state->strm.avail_in = 0; ++ state->strm.next_in = state->in; + return 0; ++ } + len -= n; + } while (len); + } diff --git a/meta/recipes-core/zlib/zlib_1.3.1.bb b/meta/recipes-core/zlib/zlib_1.3.1.bb index e42578fd7e..bfcf8ea2ee 100644 --- a/meta/recipes-core/zlib/zlib_1.3.1.bb +++ b/meta/recipes-core/zlib/zlib_1.3.1.bb @@ -11,6 +11,7 @@ SRC_URI = "https://zlib.net/${BP}.tar.gz \ file://0001-configure-Pass-LDFLAGS-to-link-tests.patch \ file://run-ptest \ file://CVE-2026-27171.patch \ + file://CVE-2026-85091.patch \ " UPSTREAM_CHECK_URI = "http://zlib.net/"