diff options
Diffstat (limited to 'meta/recipes-extended/gawk')
-rw-r--r-- | meta/recipes-extended/gawk/gawk/CVE-2023-4156.patch | 28 | ||||
-rw-r--r-- | meta/recipes-extended/gawk/gawk/remove-sensitive-tests.patch | 24 | ||||
-rw-r--r-- | meta/recipes-extended/gawk/gawk_5.0.1.bb | 15 |
3 files changed, 64 insertions, 3 deletions
diff --git a/meta/recipes-extended/gawk/gawk/CVE-2023-4156.patch b/meta/recipes-extended/gawk/gawk/CVE-2023-4156.patch new file mode 100644 index 0000000000..c6cba058a7 --- /dev/null +++ b/meta/recipes-extended/gawk/gawk/CVE-2023-4156.patch | |||
@@ -0,0 +1,28 @@ | |||
1 | From e709eb829448ce040087a3fc5481db6bfcaae212 Mon Sep 17 00:00:00 2001 | ||
2 | From: "Arnold D. Robbins" <arnold@skeeve.com> | ||
3 | Date: Wed, 3 Aug 2022 13:00:54 +0300 | ||
4 | Subject: [PATCH] Smal bug fix in builtin.c. | ||
5 | |||
6 | Upstream-Status: Backport [import from ubuntu https://git.launchpad.net/ubuntu/+source/gawk/tree/debian/patches/CVE-2023-4156.patch?h=ubuntu/focal-security | ||
7 | Upstream commit https://git.savannah.gnu.org/gitweb/?p=gawk.git;a=commitdiff;h=e709eb829448ce040087a3fc5481db6bfcaae212] | ||
8 | CVE: CVE-2023-4156 | ||
9 | Signed-off-by: Vijay Anusuri <vanusuri@mvista.com> | ||
10 | --- | ||
11 | ChangeLog | 6 ++++++ | ||
12 | builtin.c | 5 ++++- | ||
13 | 2 files changed, 10 insertions(+), 1 deletion(-) | ||
14 | |||
15 | --- gawk-5.1.0.orig/builtin.c | ||
16 | +++ gawk-5.1.0/builtin.c | ||
17 | @@ -957,7 +957,10 @@ check_pos: | ||
18 | s1++; | ||
19 | n0--; | ||
20 | } | ||
21 | - if (val >= num_args) { | ||
22 | + // val could be less than zero if someone provides a field width | ||
23 | + // so large that it causes integer overflow. Mainly fuzzers do this, | ||
24 | + // but let's try to be good anyway. | ||
25 | + if (val < 0 || val >= num_args) { | ||
26 | toofew = true; | ||
27 | break; | ||
28 | } | ||
diff --git a/meta/recipes-extended/gawk/gawk/remove-sensitive-tests.patch b/meta/recipes-extended/gawk/gawk/remove-sensitive-tests.patch new file mode 100644 index 0000000000..167c0787ee --- /dev/null +++ b/meta/recipes-extended/gawk/gawk/remove-sensitive-tests.patch | |||
@@ -0,0 +1,24 @@ | |||
1 | These tests require an unloaded host as otherwise timing sensitive tests can fail | ||
2 | https://bugzilla.yoctoproject.org/show_bug.cgi?id=14371 | ||
3 | |||
4 | Upstream-Status: Inappropriate | ||
5 | Signed-off-by: Ross Burton <ross.burton@arm.com> | ||
6 | |||
7 | --- a/test/Maketests~ | ||
8 | +++ b/test/Maketests | ||
9 | @@ -2069,7 +2069,2 @@ | ||
10 | |||
11 | -timeout: | ||
12 | - @echo $@ $(ZOS_FAIL) | ||
13 | - @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ | ||
14 | - @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ | ||
15 | - | ||
16 | typedregex1: | ||
17 | @@ -2297,7 +2292,2 @@ | ||
18 | @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ | ||
19 | - | ||
20 | -time: | ||
21 | - @echo $@ | ||
22 | - @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ | ||
23 | - @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ | ||
24 | |||
diff --git a/meta/recipes-extended/gawk/gawk_5.0.1.bb b/meta/recipes-extended/gawk/gawk_5.0.1.bb index e79ccfdebf..c71890c19e 100644 --- a/meta/recipes-extended/gawk/gawk_5.0.1.bb +++ b/meta/recipes-extended/gawk/gawk_5.0.1.bb | |||
@@ -16,7 +16,9 @@ PACKAGECONFIG[readline] = "--with-readline,--without-readline,readline" | |||
16 | PACKAGECONFIG[mpfr] = "--with-mpfr,--without-mpfr, mpfr" | 16 | PACKAGECONFIG[mpfr] = "--with-mpfr,--without-mpfr, mpfr" |
17 | 17 | ||
18 | SRC_URI = "${GNU_MIRROR}/gawk/gawk-${PV}.tar.gz \ | 18 | SRC_URI = "${GNU_MIRROR}/gawk/gawk-${PV}.tar.gz \ |
19 | file://remove-sensitive-tests.patch \ | ||
19 | file://run-ptest \ | 20 | file://run-ptest \ |
21 | file://CVE-2023-4156.patch \ | ||
20 | " | 22 | " |
21 | 23 | ||
22 | SRC_URI[md5sum] = "c5441c73cc451764055ee65e9a4292bb" | 24 | SRC_URI[md5sum] = "c5441c73cc451764055ee65e9a4292bb" |
@@ -41,13 +43,20 @@ inherit ptest | |||
41 | do_install_ptest() { | 43 | do_install_ptest() { |
42 | mkdir ${D}${PTEST_PATH}/test | 44 | mkdir ${D}${PTEST_PATH}/test |
43 | ln -s ${bindir}/gawk ${D}${PTEST_PATH}/gawk | 45 | ln -s ${bindir}/gawk ${D}${PTEST_PATH}/gawk |
44 | for i in `grep -vE "@|^$|#|Gt-dummy" ${S}/test/Maketests |awk -F: '{print $1}'` Maketests inclib.awk; \ | 46 | # The list of tests is all targets in Maketests, apart from the dummy Gt-dummy |
45 | do cp ${S}/test/$i* ${D}${PTEST_PATH}/test; \ | 47 | TESTS=$(awk -F: '$1 == "Gt-dummy" { next } /[[:alnum:]]+:$/ { print $1 }' ${S}/test/Maketests) |
48 | for i in $TESTS Maketests inclib.awk; do | ||
49 | cp ${S}/test/$i* ${D}${PTEST_PATH}/test | ||
46 | done | 50 | done |
47 | sed -i -e 's|/usr/local/bin|${bindir}|g' \ | 51 | sed -i -e 's|/usr/local/bin|${bindir}|g' \ |
48 | -e 's|#!${base_bindir}/awk|#!${bindir}/awk|g' ${D}${PTEST_PATH}/test/*.awk | 52 | -e 's|#!${base_bindir}/awk|#!${bindir}/awk|g' ${D}${PTEST_PATH}/test/*.awk |
49 | 53 | ||
50 | sed -i -e "s|GAWKLOCALE|LANG|g" ${D}${PTEST_PATH}/test/Maketests | 54 | sed -i -e "s|GAWKLOCALE|LANG|g" ${D}${PTEST_PATH}/test/Maketests |
55 | |||
56 | # These tests require an unloaded host as otherwise timing sensitive tests can fail | ||
57 | # https://bugzilla.yoctoproject.org/show_bug.cgi?id=14371 | ||
58 | rm -f ${D}${PTEST_PATH}/test/time.* | ||
59 | rm -f ${D}${PTEST_PATH}/test/timeout.* | ||
51 | } | 60 | } |
52 | 61 | ||
53 | RDEPENDS_${PN}-ptest += "make" | 62 | RDEPENDS_${PN}-ptest += "make" |