gzip: fix CVE-2026-41992
PATCH 1/1 gzip: fix CVE-2026-41992
Backport upstream fix for a global buffer overflow in the LZH decompression logic (unlzh.c). The left[] and right[] global arrays shared across LZW and LZH decompression routines are not reinitialized between files processed in the same invocation, allowing an out-of-bounds read in the LZH decoder.
Reference: https://nvd.nist.gov/vuln/detail/CVE-2026-41992
--- .../gzip/gzip-1.14/CVE-2026-41992.patch | 32 +++++++++++++++++++ meta/recipes-extended/gzip/gzip_1.14.bb | 1 + 2 files changed, 33 insertions(+) create mode 100644 meta/recipes-extended/gzip/gzip-1.14/CVE-2026-41992.patch
meta/recipes-extended/gzip/gzip-1.14/CVE-2026-41992.patch new file +32 -0
@@ -0,0 +1,32 @@ +From 63dbf6b3b9e6e781df1a6a64e609b10e23969681 Mon Sep 17 00:00:00 2001 +From: Paul Eggert <[email protected]> +Date: Wed, 15 Apr 2026 12:00:17 -0700 +Subject: gzip: don't mishandle .lzh after .Z + +Problem reported by Michal Majchrowicz. +* unlzh.c (read_c_len): Clear left and right when n == 0. + +CVE: CVE-2026-41992 +Upstream-Status: Backport [https://cgit.git.savannah.gnu.org/cgit/gzip.git/commit/?id=63dbf6b3b9e6e781df1a6a64e609b10e23969681] +Signed-off-by: Jaipaul Cheernam <[email protected]> +--- + unlzh.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/unlzh.c b/unlzh.c +index 3320196..a6cf109 100644 +--- a/unlzh.c ++++ b/unlzh.c +@@ -232,6 +232,12 @@ read_c_len () + c = getbits(CBIT); + for (i = 0; i < NC; i++) c_len[i] = 0; + for (i = 0; i < 4096; i++) c_table[i] = c; ++ ++ /* Needed in case LEFT and RIGHT are reused from a previous ++ LZW decompression. It may be overkill to clear all of both ++ arrays, but nobody has had time to analyze this carefully. */ ++ memzero(left, (2 * NC - 1) * sizeof *left); ++ memzero(right, (2 * NC - 1) * sizeof *left); + } else { + i = 0; + while (i < n) {
meta/recipes-extended/gzip/gzip_1.14.bb +1 -0
@@ -6,6 +6,7 @@ LICENSE = "GPL-3.0-or-later" SRC_URI = "${GNU_MIRROR}/gzip/${BP}.tar.gz \ file://run-ptest \ + file://CVE-2026-41992.patch \ " SRC_URI:append:class-target = " file://wrong-path-fix.patch"
Signature · 1 line
2.34.1
PATCH 1/1 gzip: fix CVE-2026-41992
Backport upstream fix for a global buffer overflow in the LZH decompression logic (unlzh.c). The left[] and right[] global arrays shared across LZW and LZH decompression routines are not reinitialized between files processed in the same invocation, allowing an out-of-bounds read in the LZH decoder.
Reference: https://nvd.nist.gov/vuln/detail/CVE-2026-41992
--- .../gzip/gzip-1.13/CVE-2026-41992.patch | 32 +++++++++++++++++++ meta/recipes-extended/gzip/gzip_1.13.bb | 1 + 2 files changed, 33 insertions(+) create mode 100644 meta/recipes-extended/gzip/gzip-1.13/CVE-2026-41992.patch
meta/recipes-extended/gzip/gzip-1.13/CVE-2026-41992.patch new file +32 -0
@@ -0,0 +1,32 @@ +From 63dbf6b3b9e6e781df1a6a64e609b10e23969681 Mon Sep 17 00:00:00 2001 +From: Paul Eggert <[email protected]> +Date: Wed, 15 Apr 2026 12:00:17 -0700 +Subject: gzip: don't mishandle .lzh after .Z + +Problem reported by Michal Majchrowicz. +* unlzh.c (read_c_len): Clear left and right when n == 0. + +CVE: CVE-2026-41992 +Upstream-Status: Backport [https://cgit.git.savannah.gnu.org/cgit/gzip.git/commit/?id=63dbf6b3b9e6e781df1a6a64e609b10e23969681] +Signed-off-by: Jaipaul Cheernam <[email protected]> +--- + unlzh.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/unlzh.c b/unlzh.c +index 3320196..a6cf109 100644 +--- a/unlzh.c ++++ b/unlzh.c +@@ -232,6 +232,12 @@ read_c_len () + c = getbits(CBIT); + for (i = 0; i < NC; i++) c_len[i] = 0; + for (i = 0; i < 4096; i++) c_table[i] = c; ++ ++ /* Needed in case LEFT and RIGHT are reused from a previous ++ LZW decompression. It may be overkill to clear all of both ++ arrays, but nobody has had time to analyze this carefully. */ ++ memzero(left, (2 * NC - 1) * sizeof *left); ++ memzero(right, (2 * NC - 1) * sizeof *left); + } else { + i = 0; + while (i < n) {
meta/recipes-extended/gzip/gzip_1.13.bb +1 -0
@@ -6,6 +6,7 @@ LICENSE = "GPL-3.0-or-later" SRC_URI = "${GNU_MIRROR}/gzip/${BP}.tar.gz \ file://run-ptest \ + file://CVE-2026-41992.patch \ " SRC_URI:append:class-target = " file://wrong-path-fix.patch"
Signature · 1 line
2.34.1
PATCH v2 1/1 gzip: fix CVE-2026-41992
Backport upstream fix for a global buffer overflow in the LZH decompression logic (unlzh.c). The left[] and right[] global arrays shared across LZW and LZH decompression routines are not reinitialized between files processed in the same invocation, allowing an out-of-bounds read in the LZH decoder.
Adapted for gzip 1.13:
- Refreshed NEWS and THANKS hunks to match 1.13 release context.
Reference: https://nvd.nist.gov/vuln/detail/CVE-2026-41992
---
Changes in v2:
- Include full upstream patch (NEWS, THANKS, unlzh.c) instead of only unlzh.c
- Preserve original UTF-8 encoding in Subject and commit message
- Refreshed NEWS and THANKS hunks for target gzip version
.../gzip/gzip-1.13/CVE-2026-41992.patch | 64 +++++++++++++++++++ meta/recipes-extended/gzip/gzip_1.13.bb | 1 + 2 files changed, 65 insertions(+) create mode 100644 meta/recipes-extended/gzip/gzip-1.13/CVE-2026-41992.patch
meta/recipes-extended/gzip/gzip-1.13/CVE-2026-41992.patch new file +64 -0
@@ -0,0 +1,64 @@ +From 63dbf6b3b9e6e781df1a6a64e609b10e23969681 Mon Sep 17 00:00:00 2001 +From: Paul Eggert <[email protected]> +Date: Wed, 15 Apr 2026 12:00:17 -0700 +Subject: =?UTF-8?q?gzip:=20don=E2=80=99t=20mishandle=20.lzh=20after=20.Z?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Problem reported by Michał Majchrowicz. +* unlzh.c (read_c_len): Clear left and right when n == 0. + +CVE: CVE-2026-41992 +Upstream-Status: Backport [https://cgit.git.savannah.gnu.org/cgit/gzip.git/commit/?id=63dbf6b3b9e6e781df1a6a64e609b10e23969681] +Signed-off-by: Jaipaul Cheernam <[email protected]> +--- + NEWS | 4 ++++ + THANKS | 1 + + unlzh.c | 6 ++++++ + 3 files changed, 11 insertions(+) + +diff --git a/NEWS b/NEWS +index bdb7cc0..af2a08f 100644 +--- a/NEWS ++++ b/NEWS +@@ -14,6 +14,10 @@ GNU gzip NEWS -*- outline -*- + + ** Bug fixes + ++ A buffer overflow has been fixed when decompressing an .lzh file ++ after decompressing a .Z file. ++ [bug present since the beginning] ++ + 'gzip -d' no longer fails to report invalid compressed data + that uses a dictionary distance outside the input window. + [bug present since the beginning] +diff --git a/THANKS b/THANKS +index 4e545d9..a7d25e4 100644 +--- a/THANKS ++++ b/THANKS +@@ -186,6 +186,7 @@ Jamie Lokier [email protected] + Richard Lloyd [email protected] + David J. MacKenzie [email protected] + John R MacMillan [email protected] ++Michał Majchrowicz [email protected] + Ron Male [email protected] + Jakub Martisko [email protected] + Don R. Maszle [email protected] +diff --git a/unlzh.c b/unlzh.c +index 3320196..a6cf109 100644 +--- a/unlzh.c ++++ b/unlzh.c +@@ -232,6 +232,12 @@ read_c_len () + c = getbits(CBIT); + for (i = 0; i < NC; i++) c_len[i] = 0; + for (i = 0; i < 4096; i++) c_table[i] = c; ++ ++ /* Needed in case LEFT and RIGHT are reused from a previous ++ LZW decompression. It may be overkill to clear all of both ++ arrays, but nobody has had time to analyze this carefully. */ ++ memzero(left, (2 * NC - 1) * sizeof *left); ++ memzero(right, (2 * NC - 1) * sizeof *left); + } else { + i = 0; + while (i < n) {
meta/recipes-extended/gzip/gzip_1.13.bb +1 -0
@@ -6,6 +6,7 @@ LICENSE = "GPL-3.0-or-later" SRC_URI = "${GNU_MIRROR}/gzip/${BP}.tar.gz \ file://run-ptest \ + file://CVE-2026-41992.patch \ " SRC_URI:append:class-target = " file://wrong-path-fix.patch"
Signature · 1 line
2.34.1
PATCH 1/1 gzip: fix CVE-2026-41992
In reply to Jaipaul CheernamBackport upstream fix for a global buffer overflow in the LZH decompression logic (unlzh.c). The left[] and right[] global arrays shared across LZW and LZH decompression routines are not reinitialized between files processed in the same invocation, allowing an out-of-bounds read in the LZH decoder.
Reference: https://nvd.nist.gov/vuln/detail/CVE-2026-41992
--- .../gzip/gzip-1.14/CVE-2026-41992.patch | 32 +++++++++++++++++++ meta/recipes-extended/gzip/gzip_1.14.bb | 1 + 2 files changed, 33 insertions(+) create mode 100644 meta/recipes-extended/gzip/gzip-1.14/CVE-2026-41992.patch
meta/recipes-extended/gzip/gzip-1.14/CVE-2026-41992.patch new file +32 -0
@@ -0,0 +1,32 @@ +From 63dbf6b3b9e6e781df1a6a64e609b10e23969681 Mon Sep 17 00:00:00 2001 +From: Paul Eggert <[email protected]> +Date: Wed, 15 Apr 2026 12:00:17 -0700 +Subject: gzip: don't mishandle .lzh after .Z + +Problem reported by Michal Majchrowicz. +* unlzh.c (read_c_len): Clear left and right when n == 0. + +CVE: CVE-2026-41992 +Upstream-Status: Backport [https://cgit.git.savannah.gnu.org/cgit/gzip.git/commit/?id=63dbf6b3b9e6e781df1a6a64e609b10e23969681] +Signed-off-by: Jaipaul Cheernam <[email protected]> +--- + unlzh.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/unlzh.c b/unlzh.c +index 3320196..a6cf109 100644 +--- a/unlzh.c ++++ b/unlzh.c +@@ -232,6 +232,12 @@ read_c_len () + c = getbits(CBIT); + for (i = 0; i < NC; i++) c_len[i] = 0; + for (i = 0; i < 4096; i++) c_table[i] = c; ++ ++ /* Needed in case LEFT and RIGHT are reused from a previous ++ LZW decompression. It may be overkill to clear all of both ++ arrays, but nobody has had time to analyze this carefully. */ ++ memzero(left, (2 * NC - 1) * sizeof *left); ++ memzero(right, (2 * NC - 1) * sizeof *left); + } else { + i = 0; + while (i < n) {
meta/recipes-extended/gzip/gzip_1.14.bb +1 -0
@@ -6,6 +6,7 @@ LICENSE = "GPL-3.0-or-later" SRC_URI = "${GNU_MIRROR}/gzip/${BP}.tar.gz \ file://run-ptest \ + file://CVE-2026-41992.patch \ " SRC_URI:append:class-target = " file://wrong-path-fix.patch"
Signature · 1 line
2.34.1
PATCH v2 1/1 gzip: fix CVE-2026-41992
Backport upstream fix for a global buffer overflow in the LZH decompression logic (unlzh.c). The left[] and right[] global arrays shared across LZW and LZH decompression routines are not reinitialized between files processed in the same invocation, allowing an out-of-bounds read in the LZH decoder.
Adapted for gzip 1.14:
- Refreshed NEWS and THANKS hunks to match 1.14 release context.
Reference: https://nvd.nist.gov/vuln/detail/CVE-2026-41992
---
Changes in v2:
- Include full upstream patch (NEWS, THANKS, unlzh.c) instead of only unlzh.c
- Preserve original UTF-8 encoding in Subject and commit message
- Refreshed NEWS and THANKS hunks for target gzip version
.../gzip/gzip-1.14/CVE-2026-41992.patch | 64 +++++++++++++++++++ meta/recipes-extended/gzip/gzip_1.14.bb | 1 + 2 files changed, 65 insertions(+) create mode 100644 meta/recipes-extended/gzip/gzip-1.14/CVE-2026-41992.patch
meta/recipes-extended/gzip/gzip-1.14/CVE-2026-41992.patch new file +64 -0
@@ -0,0 +1,64 @@ +From 63dbf6b3b9e6e781df1a6a64e609b10e23969681 Mon Sep 17 00:00:00 2001 +From: Paul Eggert <[email protected]> +Date: Wed, 15 Apr 2026 12:00:17 -0700 +Subject: =?UTF-8?q?gzip:=20don=E2=80=99t=20mishandle=20.lzh=20after=20.Z?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Problem reported by Michał Majchrowicz. +* unlzh.c (read_c_len): Clear left and right when n == 0. + +CVE: CVE-2026-41992 +Upstream-Status: Backport [https://cgit.git.savannah.gnu.org/cgit/gzip.git/commit/?id=63dbf6b3b9e6e781df1a6a64e609b10e23969681] +Signed-off-by: Jaipaul Cheernam <[email protected]> +--- + NEWS | 4 ++++ + THANKS | 1 + + unlzh.c | 6 ++++++ + 3 files changed, 11 insertions(+) + +diff --git a/NEWS b/NEWS +index 6388227..8fb8918 100644 +--- a/NEWS ++++ b/NEWS +@@ -4,6 +4,10 @@ GNU gzip NEWS -*- outline -*- + + ** Bug fixes + ++ A buffer overflow has been fixed when decompressing an .lzh file ++ after decompressing a .Z file. ++ [bug present since the beginning] ++ + 'gzip -d' no longer omits the last partial output buffer when the + input ends unexpectedly on an IBM Z platform. + [bug introduced in gzip-1.11] +diff --git a/THANKS b/THANKS +index 4e545d9..a7d25e4 100644 +--- a/THANKS ++++ b/THANKS +@@ -186,6 +186,7 @@ Jamie Lokier [email protected] + Richard Lloyd [email protected] + David J. MacKenzie [email protected] + John R MacMillan [email protected] ++Michał Majchrowicz [email protected] + Ron Male [email protected] + Jakub Martisko [email protected] + Don R. Maszle [email protected] +diff --git a/unlzh.c b/unlzh.c +index 3320196..a6cf109 100644 +--- a/unlzh.c ++++ b/unlzh.c +@@ -232,6 +232,12 @@ read_c_len () + c = getbits(CBIT); + for (i = 0; i < NC; i++) c_len[i] = 0; + for (i = 0; i < 4096; i++) c_table[i] = c; ++ ++ /* Needed in case LEFT and RIGHT are reused from a previous ++ LZW decompression. It may be overkill to clear all of both ++ arrays, but nobody has had time to analyze this carefully. */ ++ memzero(left, (2 * NC - 1) * sizeof *left); ++ memzero(right, (2 * NC - 1) * sizeof *left); + } else { + i = 0; + while (i < n) {
meta/recipes-extended/gzip/gzip_1.14.bb +1 -0
@@ -6,6 +6,7 @@ LICENSE = "GPL-3.0-or-later" SRC_URI = "${GNU_MIRROR}/gzip/${BP}.tar.gz \ file://run-ptest \ + file://CVE-2026-41992.patch \ " SRC_URI:append:class-target = " file://wrong-path-fix.patch"
Signature · 1 line
2.34.1
Hi Yoann,
Master commit has been merged and wrynose commit marked as Awaiting upstream, Please check and let me know if I need to send another patch.
Regards,
Jaipaul
Quoted 5 lines · Jaipaul Cheernam via lists.openembedded.org
Hi Yoann,
Master commit has been merged and wrynose commit marked as Awaiting upstream, Please check and let me know if I need to send another patch.
Noted, thanks for the ping.
I've put both scarhgap/wrynose patches in the review lists.
Regards,
Quoted 14 lines
Regards,
Jaipaul-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#241156):
https://lists.openembedded.org/g/openembedded-core/message/241156
Mute This Topic: https://lists.openembedded.org/mt/120178637/4316185
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
Signature · 2 lines
Yoann Congal Smile ECS
Quoted 21 lines · Jaipaul Cheernam via lists.openembedded.org
Backport upstream fix for a global buffer overflow in the LZH decompression logic (
unlzh.c). The left[] and right[] global arrays shared across LZW and LZH decompression routines are not reinitialized between files processed in the same invocation, allowing an out-of-bounds read in the LZH decoder.Reference: https://nvd.nist.gov/vuln/detail/CVE-2026-41992
Signed-off-by Jaipaul Cheernam <[email protected]>--- .../gzip/gzip-1.14/CVE-2026-41992.patch | 32 +++++++++++++++++++ meta/recipes-extended/gzip/gzip_1.14.bb | 1 + 2 files changed, 33 insertions(+) create mode 100644 meta/recipes-extended/gzip/gzip-1.14/CVE-2026-41992.patchmeta/recipes-extended/gzip/gzip-1.14/CVE-2026-41992.patch new file +1
-0@@ -0,0 +1,32 @@ +From 63dbf6b3b9e6e781df1a6a64e609b10e23969681 Mon Sep 17 00:00:00 2001
meta/recipes-extended/gzip/gzip-1.14/CVE-2026-41992.patch line 11
Quoted 10 lines
meta/recipes-extended/gzip/gzip-1.14/CVE-2026-41992.patch new file +10
-0+From: Paul Eggert <[email protected]> +Date: Wed, 15 Apr 2026 12:00:17 -0700 +Subject: gzip: don't mishandle .lzh after .Z + +Problem reported by Michal Majchrowicz. +* unlzh.c (read_c_len): Clear left and right when n == 0. + +CVE: CVE-2026-41992 +Upstream-Status: Backport [https://cgit.git.savannah.gnu.org/cgit/gzip.git/commit/?id=63dbf6b3b9e6e781df1a6a64e609b10e23969681] +Signed-off-by: Jaipaul Cheernam <[email protected]>
Hello,
This patch is slightly different from upstream (without explanation):
-Subject: =?UTF-8?q?gzip:=20don=E2=80=99t=20mishandle=20.lzh=20after=20.Z?= -MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit
+Subject: gzip: don't mishandle .lzh after .Z
-Problem reported by Michał Majchrowicz.
+Problem reported by Michal Majchrowicz.
... and the THANKS file was dropped.
Michał name was transcribed as Michal. I don't know how "nitpickery" it is...
Regards,
Signature · 2 lines
Yoann Congal Smile ECS
Hi Yoann,
Something went wrong from myside. I will check and share v2 .
Apologies for the confusion.
Regards,
Jaipaul
________________________________
From: Yoann Congal <[email protected]>
Sent: Wednesday, July 8, 2026 5:19 PM
To: Jaipaul Cheernam <[email protected]>; [email protected] <[email protected]>
Subject: Re: [OE-core] [PATCH] gzip: fix CVE-2026-41992
Quoted 21 lines · Jaipaul Cheernam via lists.openembedded.org
Backport upstream fix for a global buffer overflow in the LZH decompression logic (
unlzh.c). The left[] and right[] global arrays shared across LZW and LZH decompression routines are not reinitialized between files processed in the same invocation, allowing an out-of-bounds read in the LZH decoder.Reference: https://nvd.nist.gov/vuln/detail/CVE-2026-41992
Signed-off-by Jaipaul Cheernam <[email protected]>--- .../gzip/gzip-1.14/CVE-2026-41992.patch | 32 +++++++++++++++++++ meta/recipes-extended/gzip/gzip_1.14.bb | 1 + 2 files changed, 33 insertions(+) create mode 100644 meta/recipes-extended/gzip/gzip-1.14/CVE-2026-41992.patchmeta/recipes-extended/gzip/gzip-1.14/CVE-2026-41992.patch new file +1
-0@@ -0,0 +1,32 @@ +From 63dbf6b3b9e6e781df1a6a64e609b10e23969681 Mon Sep 17 00:00:00 2001
meta/recipes-extended/gzip/gzip-1.14/CVE-2026-41992.patch line 11
Quoted 10 lines
meta/recipes-extended/gzip/gzip-1.14/CVE-2026-41992.patch new file +10
-0+From: Paul Eggert <[email protected]> +Date: Wed, 15 Apr 2026 12:00:17 -0700 +Subject: gzip: don't mishandle .lzh after .Z + +Problem reported by Michal Majchrowicz. +* unlzh.c (read_c_len): Clear left and right when n == 0. + +CVE: CVE-2026-41992 +Upstream-Status: Backport [https://cgit.git.savannah.gnu.org/cgit/gzip.git/commit/?id=63dbf6b3b9e6e781df1a6a64e609b10e23969681] +Signed-off-by: Jaipaul Cheernam <[email protected]>
Hello,
This patch is slightly different from upstream (without explanation):
-Subject: =?UTF-8?q?gzip:=20don=E2=80=99t=20mishandle=20.lzh=20after=20.Z?= -MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit
+Subject: gzip: don't mishandle .lzh after .Z
-Problem reported by Michał Majchrowicz.
+Problem reported by Michal Majchrowicz.
... and the THANKS file was dropped.
Michał name was transcribed as Michal. I don't know how "nitpickery" it is...
Regards,
--
Yoann Congal
Smile ECS
PATCH v2 1/1 gzip: fix CVE-2026-41992
In reply to Jaipaul CheernamBackport upstream fix for a global buffer overflow in the LZH decompression logic (unlzh.c). The left[] and right[] global arrays shared across LZW and LZH decompression routines are not reinitialized between files processed in the same invocation, allowing an out-of-bounds read in the LZH decoder.
Adapted for gzip 1.14:
- Refreshed NEWS and THANKS hunks to match 1.14 release context.
Reference: https://nvd.nist.gov/vuln/detail/CVE-2026-41992
---
Changes in v2:
- Include full upstream patch (NEWS, THANKS, unlzh.c) instead of only unlzh.c
- Preserve original UTF-8 encoding in Subject and commit message
- Refreshed NEWS and THANKS hunks for target gzip version
.../gzip/gzip-1.14/CVE-2026-41992.patch | 64 +++++++++++++++++++ meta/recipes-extended/gzip/gzip_1.14.bb | 1 + 2 files changed, 65 insertions(+) create mode 100644 meta/recipes-extended/gzip/gzip-1.14/CVE-2026-41992.patch
meta/recipes-extended/gzip/gzip-1.14/CVE-2026-41992.patch new file +64 -0
@@ -0,0 +1,64 @@ +From 63dbf6b3b9e6e781df1a6a64e609b10e23969681 Mon Sep 17 00:00:00 2001 +From: Paul Eggert <[email protected]> +Date: Wed, 15 Apr 2026 12:00:17 -0700 +Subject: =?UTF-8?q?gzip:=20don=E2=80=99t=20mishandle=20.lzh=20after=20.Z?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Problem reported by Michał Majchrowicz. +* unlzh.c (read_c_len): Clear left and right when n == 0. + +CVE: CVE-2026-41992 +Upstream-Status: Backport [https://cgit.git.savannah.gnu.org/cgit/gzip.git/commit/?id=63dbf6b3b9e6e781df1a6a64e609b10e23969681] +Signed-off-by: Jaipaul Cheernam <[email protected]> +--- + NEWS | 4 ++++ + THANKS | 1 + + unlzh.c | 6 ++++++ + 3 files changed, 11 insertions(+) + +diff --git a/NEWS b/NEWS +index 6388227..8fb8918 100644 +--- a/NEWS ++++ b/NEWS +@@ -4,6 +4,10 @@ GNU gzip NEWS -*- outline -*- + + ** Bug fixes + ++ A buffer overflow has been fixed when decompressing an .lzh file ++ after decompressing a .Z file. ++ [bug present since the beginning] ++ + 'gzip -d' no longer omits the last partial output buffer when the + input ends unexpectedly on an IBM Z platform. + [bug introduced in gzip-1.11] +diff --git a/THANKS b/THANKS +index 4e545d9..a7d25e4 100644 +--- a/THANKS ++++ b/THANKS +@@ -186,6 +186,7 @@ Jamie Lokier [email protected] + Richard Lloyd [email protected] + David J. MacKenzie [email protected] + John R MacMillan [email protected] ++Michał Majchrowicz [email protected] + Ron Male [email protected] + Jakub Martisko [email protected] + Don R. Maszle [email protected] +diff --git a/unlzh.c b/unlzh.c +index 3320196..a6cf109 100644 +--- a/unlzh.c ++++ b/unlzh.c +@@ -232,6 +232,12 @@ read_c_len () + c = getbits(CBIT); + for (i = 0; i < NC; i++) c_len[i] = 0; + for (i = 0; i < 4096; i++) c_table[i] = c; ++ ++ /* Needed in case LEFT and RIGHT are reused from a previous ++ LZW decompression. It may be overkill to clear all of both ++ arrays, but nobody has had time to analyze this carefully. */ ++ memzero(left, (2 * NC - 1) * sizeof *left); ++ memzero(right, (2 * NC - 1) * sizeof *left); + } else { + i = 0; + while (i < n) {
meta/recipes-extended/gzip/gzip_1.14.bb +1 -0
@@ -6,6 +6,7 @@ LICENSE = "GPL-3.0-or-later" SRC_URI = "${GNU_MIRROR}/gzip/${BP}.tar.gz \ file://run-ptest \ + file://CVE-2026-41992.patch \ " SRC_URI:append:class-target = " file://wrong-path-fix.patch"
Signature · 1 line
2.34.1