Skip to contentSkip to conversation

patch: Fix CVE-2026-56289

PATCH New Hetvi Thakar -X (hthakar - E INFOCHIPS PRIVATE LIMITED at Cisco) 1 participant 2 messages Jul 28

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 patch: Fix CVE-2026-56289

From: Hetvi Thakar <[email protected]>

This patch applies the upstream fix referenced by NVD in [2], using the commit shown in [1].

[1] https://cgit.git.savannah.gnu.org/cgit/patch.git/commit/?id=faba04ef4f2b410257f76c1b9dc85e350929c4b9
[2] https://nvd.nist.gov/vuln/detail/CVE-2026-56289

---
 meta/recipes-devtools/patch/patch.inc         |  4 ++-
 .../patch/patch/CVE-2026-56289.patch          | 36 +++++++++++++++++++
 2 files changed, 39 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-devtools/patch/patch/CVE-2026-56289.patch
meta/recipes-devtools/patch/patch.inc +3 -1
index 44d3046fd8..738bec038d 100644
@@ -5,7 +5,9 @@ original files, producing patched versions."
 SECTION = "utils"
 HOMEPAGE = "http://savannah.gnu.org/projects/patch/"
 
-SRC_URI = "${GNU_MIRROR}/patch/patch-${PV}.tar.gz"
+SRC_URI = "${GNU_MIRROR}/patch/patch-${PV}.tar.gz \
+	   file://CVE-2026-56289.patch"
+
 S = "${UNPACKDIR}/patch-${PV}"
 
 inherit autotools update-alternatives
meta/recipes-devtools/patch/patch/CVE-2026-56289.patch new file +36 -0
new file mode 100644
index 0000000000..8f98c444fc
@@ -0,0 +1,36 @@
+From e89f7be0853836908226e1df746fe07ef7c46769 Mon Sep 17 00:00:00 2001
+From: Paul Eggert <[email protected]>
+Date: Tue, 21 Apr 2026 13:16:10 -0700
+Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20infloop=20on=20null=20ranges?=
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Problem reported by Michał Majchrowicz.
+* src/patch.c (locate_hunk): Don’t attempt to optimize
+matches of a null range.  Instead, apply all the checks
+we apply to non-null ranges.
+
+CVE: CVE-2026-56289
+Upstream-Status: Backport [https://cgit.git.savannah.gnu.org/cgit/patch.git/commit/?id=faba04ef4f2b410257f76c1b9dc85e350929c4b9]
+
+(cherry picked from commit faba04ef4f2b410257f76c1b9dc85e350929c4b9)
+Signed-off-by: Hetvi Thakar <[email protected]>
+---
+ src/patch.c | 3 ---
+ 1 file changed, 3 deletions(-)
+
+diff --git a/src/patch.c b/src/patch.c
+index e4d0524..1e7dfdc 100644
+--- a/src/patch.c
++++ b/src/patch.c
+@@ -1166,9 +1166,6 @@ locate_hunk (idx_t fuzz)
+     ptrdiff_t max_offset = MAX (max_pos_offset, max_neg_offset);
+     ptrdiff_t min_offset;
+ 
+-    if (!pat_lines)			/* null range matches always */
+-	return first_guess;
+-
+     /* Do not try lines <= 0.  */
+     if (first_guess <= max_neg_offset)
+ 	max_neg_offset = first_guess - 1;
Signature · 1 line
2.51.0
#1 lore raw

PATCH 2/2 patch: Fix CVE-2026-56288

From: Hetvi Thakar <[email protected]>

This patch applies the upstream fix referenced by NVD in [2], using the commit shown in [1].

[1] https://cgit.git.savannah.gnu.org/cgit/patch.git/commit/?id=e6d6a4e021660679d7fc9150f981d4920f722313
[2] https://nvd.nist.gov/vuln/detail/CVE-2026-56288

---
 meta/recipes-devtools/patch/patch.inc         |  4 +-
 .../patch/patch/CVE-2026-56288.patch          | 75 +++++++++++++++++++
 2 files changed, 78 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-devtools/patch/patch/CVE-2026-56288.patch
meta/recipes-devtools/patch/patch.inc +3 -1
index 738bec038d..ecbb070ec4 100644
@@ -6,7 +6,9 @@ SECTION = "utils"
 HOMEPAGE = "http://savannah.gnu.org/projects/patch/"
 
 SRC_URI = "${GNU_MIRROR}/patch/patch-${PV}.tar.gz \
-	   file://CVE-2026-56289.patch"
+ 	   file://CVE-2026-56289.patch \
+ 	   file://CVE-2026-56288.patch \
+   	   "
 
 S = "${UNPACKDIR}/patch-${PV}"
 
meta/recipes-devtools/patch/patch/CVE-2026-56288.patch new file +75 -0

75 lines not on this page · raw message

Signature · 1 line
2.51.0