Looks good to me.

Reviewed-by: Leonid Iziumtsev <[email protected]>
________________________________
From: [email protected] 
<[email protected]> on behalf of Darsh Kelaiya -X 
(dkelaiya - E INFOCHIPS PRIVATE LIMITED at Cisco) via lists.openembedded.org 
<[email protected]>
Sent: Wednesday, July 22, 2026 11:56 AM
To: [email protected] 
<[email protected]>
Cc: [email protected] <[email protected]>; Darsh Kelaiya 
<[email protected]>
Subject: [OE-core][scarthgap][PATCH 2/4] gawk: Fix CVE-2026-40468

From: Darsh Kelaiya <[email protected]>

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

[1] 
https://cgit.git.savannah.gnu.org/cgit/gawk.git/commit/?id=062f2f2581b991362c046f7f2e238ffa34e6f8c7
[2] https://nvd.nist.gov/vuln/detail/CVE-2026-40468

Signed-off-by: Darsh Kelaiya <[email protected]>
---
 .../gawk/gawk/CVE-2026-40468.patch            | 65 +++++++++++++++++++
 meta/recipes-extended/gawk/gawk_5.3.0.bb      |  1 +
 2 files changed, 66 insertions(+)
 create mode 100644 meta/recipes-extended/gawk/gawk/CVE-2026-40468.patch

diff --git a/meta/recipes-extended/gawk/gawk/CVE-2026-40468.patch 
b/meta/recipes-extended/gawk/gawk/CVE-2026-40468.patch
new file mode 100644
index 0000000000..607f641615
--- /dev/null
+++ b/meta/recipes-extended/gawk/gawk/CVE-2026-40468.patch
@@ -0,0 +1,65 @@
+From e281dfa04afc4660419ad69c9f24bc6b4067f8d8 Mon Sep 17 00:00:00 2001
+From: "Arnold D. Robbins" <[email protected]>
+Date: Sat, 4 Apr 2026 21:45:58 +0300
+Subject: [PATCH] Minor integer overflow fixes.
+
+CVE: CVE-2026-40468
+Upstream-Status: Backport 
[https://cgit.git.savannah.gnu.org/cgit/gawk.git/commit/?id=062f2f2581b991362c046f7f2e238ffa34e6f8c7]
+
+Backport Changes:
+- Adapt the parse_escape() type change for gawk 5.3.0, where i is
+  declared int instead of long.
+
+(cherry picked from commit 062f2f2581b991362c046f7f2e238ffa34e6f8c7)
+Signed-off-by: Darsh Kelaiya <[email protected]>
+---
+ ChangeLog | 8 ++++++++
+ builtin.c | 2 +-
+ node.c    | 2 +-
+ 3 files changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/ChangeLog b/ChangeLog
+index 6bc88ebb..e691b241 100644
+--- a/ChangeLog
++++ b/ChangeLog
+@@ -1,3 +1,11 @@
++2026-04-04         Arnold D. Robbins     <[email protected]>
++
++      * builtin.c (do_sub): Make `sofar' be size_t to avoid
++      integer overflows.  Thanks to MichaƂ Majchrowicz
++      <[email protected]> for the report.
++      * node.c (parse_escape): Change `i' to int64_t to avoid
++      overflows. Thanks to ASan with gcc -m32.
++
+ 2026-04-03         Arnold D. Robbins     <[email protected]>
+
+        * io.c (do_getline_redir): Don't DEREF redir_exp too early.
+diff --git a/builtin.c b/builtin.c
+index ba3459db..80ab6069 100644
+--- a/builtin.c
++++ b/builtin.c
+@@ -2985,7 +2985,7 @@ do_sub(int nargs, unsigned int flags)
+        char *repl;
+        char *replend;
+        size_t repllen;
+-      int sofar;
++      size_t sofar;
+        int ampersands;
+        int matches = 0;
+        Regexp *rp;
+diff --git a/node.c b/node.c
+index f08a57d7..12a8fab4 100644
+--- a/node.c
++++ b/node.c
+@@ -571,7 +571,7 @@ parse_escape(const char **string_ptr, const char **result, 
size_t *nbytes)
+        static char buf[MB_LEN_MAX];
+        enum escape_results retval = ESCAPE_OK;
+        int c = *(*string_ptr)++;
+-      int i;
++      int64_t i;
+        int count;
+        int j;
+        const char *start;
+--
+2.44.4
+
diff --git a/meta/recipes-extended/gawk/gawk_5.3.0.bb 
b/meta/recipes-extended/gawk/gawk_5.3.0.bb
index 56d7d7f76a..d79b0222a6 100644
--- a/meta/recipes-extended/gawk/gawk_5.3.0.bb
+++ b/meta/recipes-extended/gawk/gawk_5.3.0.bb
@@ -23,6 +23,7 @@ SRC_URI = "${GNU_MIRROR}/gawk/gawk-${PV}.tar.gz \
            file://run-ptest \
            file://0001-Fix-some-C23-compilatio-issues.patch \
            file://CVE-2026-40467.patch \
+           file://CVE-2026-40468.patch \
            "

 SRC_URI[sha256sum] = 
"378f8864ec21cfceaa048f7e1869ac9b4597b449087caf1eb55e440d30273336"
--
2.35.6

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#241679): 
https://lists.openembedded.org/g/openembedded-core/message/241679
Mute This Topic: https://lists.openembedded.org/mt/120391333/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

  • ... Darsh Kelaiya -X (dkelaiya - E INFOCHIPS PRIVATE LIMITED at Cisco) via lists.openembedded.org
    • ... Darsh Kelaiya -X (dkelaiya - E INFOCHIPS PRIVATE LIMITED at Cisco) via lists.openembedded.org
      • ... Leonid Iziumtsev
    • ... Darsh Kelaiya -X (dkelaiya - E INFOCHIPS PRIVATE LIMITED at Cisco) via lists.openembedded.org
      • ... Leonid Iziumtsev
    • ... Darsh Kelaiya -X (dkelaiya - E INFOCHIPS PRIVATE LIMITED at Cisco) via lists.openembedded.org
      • ... Leonid Iziumtsev
    • ... Leonid Iziumtsev

Reply via email to