Openembedded Core Discussions
 help / color / mirror / Atom feed
From: "Devansh Patel -X (devanshp - E INFOCHIPS PRIVATE LIMITED at Cisco)" <devanshp@cisco.com>
To: openembedded-core@lists.openembedded.org
Subject: [OE-core][scarthgap][PATCH 1/2] zlib: fix CVE-2026-85091
Date: Tue, 24 Nov 2026 01:49:32 -0800	[thread overview]
Message-ID: <20261124094933.1559995-1-devanshp@cisco.com> (raw)

From: Devansh Patel <devanshp@cisco.com>

This patch applies the upstream zlib 1.4 backport for
CVE-2026-85091. The upstream fix commit is referenced in [1], and
the public CVE advisory is referenced in [2].

Reset the retained caller-buffer input state after a failed direct
write. Adapt the error branch to zlib 1.3.1 while retaining its
existing return value; non-blocking support is not required.

[1] https://github.com/madler/zlib/commit/df84af25dc1942490e1d1c899a07619152a46148
[2] https://www.cve.org/CVERecord?id=CVE-2026-85091

Signed-off-by: Devansh Patel <devanshp@cisco.com>
---
 .../zlib/zlib/CVE-2026-85091.patch            | 40 +++++++++++++++++++
 meta/recipes-core/zlib/zlib_1.3.1.bb          |  1 +
 2 files changed, 41 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 00000000..1905df18
--- /dev/null
+++ b/meta/recipes-core/zlib/zlib/CVE-2026-85091.patch
@@ -0,0 +1,40 @@
+From 529a7dec05d4d7c39582715bf2b9c50ec633b5f4 Mon Sep 17 00:00:00 2001
+From: Mark Adler <git@madler.net>
+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]
+
+Backport Changes:
+- The original hunk does not apply to zlib 1.3.1, which lacks the
+  later ret/state->again write accounting. Reset the same two input
+  fields in its existing gz_comp() failure branch and preserve its
+  return 0 behavior. No non-blocking support prerequisite is needed.
+
+AI-Generated: Uses Codex
+(cherry picked from commit df84af25dc1942490e1d1c899a07619152a46148)
+Signed-off-by: Devansh Patel <devanshp@cisco.com>
+---
+ 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 e42578fd..bfcf8ea2 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/"
 
-- 
2.35.6


             reply	other threads:[~2026-11-24  9:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-24  9:49 Devansh Patel -X (devanshp - E INFOCHIPS PRIVATE LIMITED at Cisco) [this message]
2026-11-24  9:49 ` [OE-core][scarthgap][PATCH 2/2] zlib: Ignore CVE-2026-76844 Devansh Patel -X (devanshp - E INFOCHIPS PRIVATE LIMITED at Cisco)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261124094933.1559995-1-devanshp@cisco.com \
    --to=devanshp@cisco.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox