Skip to content

Commit

Permalink
gawk: backport Debian patch to fix CVE-2023-4156
Browse files Browse the repository at this point in the history
Source: poky-nut
MR: 127628, 128894
Type: Security Fix
Disposition: Merged from poky-nut
ChangeID: 0547b60d3485c2e3853e5a9e0a3e051882b283f3
Description:

Upstream-Status: Backport
[https://git.launchpad.net/ubuntu/+source/gawk/tree/debian/patches?h=ubuntu/jammy-security
&
https://git.savannah.gnu.org/gitweb/?p=gawk.git;a=commitdiff;h=e709eb829448ce040087a3fc5481db6bfcaae212]

Signed-off-by: Vijay Anusuri <[email protected]>
Signed-off-by: Steve Sakoman <[email protected]>
Signed-off-by: Jeremy A. Puhlman <[email protected]>
  • Loading branch information
anusurivijay authored and jpuhlman committed Oct 23, 2023
1 parent dfd425b commit 3175d4a
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
28 changes: 28 additions & 0 deletions meta/recipes-extended/gawk/gawk/CVE-2023-4156.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
From e709eb829448ce040087a3fc5481db6bfcaae212 Mon Sep 17 00:00:00 2001
From: "Arnold D. Robbins" <[email protected]>
Date: Wed, 3 Aug 2022 13:00:54 +0300
Subject: [PATCH] Smal bug fix in builtin.c.

Upstream-Status: Backport [import from ubuntu https://git.launchpad.net/ubuntu/+source/gawk/tree/debian/patches/CVE-2023-4156.patch?h=ubuntu/jammy-security
Upstream commit https://git.savannah.gnu.org/gitweb/?p=gawk.git;a=commitdiff;h=e709eb829448ce040087a3fc5481db6bfcaae212]
CVE: CVE-2023-4156
Signed-off-by: Vijay Anusuri <[email protected]>
---
ChangeLog | 6 ++++++
builtin.c | 5 ++++-
2 files changed, 10 insertions(+), 1 deletion(-)

--- gawk-5.1.0.orig/builtin.c
+++ gawk-5.1.0/builtin.c
@@ -957,7 +957,10 @@ check_pos:
s1++;
n0--;
}
- if (val >= num_args) {
+ // val could be less than zero if someone provides a field width
+ // so large that it causes integer overflow. Mainly fuzzers do this,
+ // but let's try to be good anyway.
+ if (val < 0 || val >= num_args) {
toofew = true;
break;
}
1 change: 1 addition & 0 deletions meta/recipes-extended/gawk/gawk_5.1.1.bb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ PACKAGECONFIG[mpfr] = "--with-mpfr,--without-mpfr, mpfr"
SRC_URI = "${GNU_MIRROR}/gawk/gawk-${PV}.tar.gz \
file://remove-sensitive-tests.patch \
file://run-ptest \
file://CVE-2023-4156.patch \
"

SRC_URI[sha256sum] = "6168d8d1dc8f74bd17d9dc22fa9634c49070f232343b744901da15fb4f06bffd"
Expand Down

0 comments on commit 3175d4a

Please sign in to comment.