summaryrefslogtreecommitdiff
path: root/aports/busybox/CVE-2022-30065.patch
diff options
context:
space:
mode:
authorPÁLI Gábor János <pali.gabor@gmail.com>2022-12-30 14:47:25 +0100
committerPÁLI Gábor János <pali.gabor@gmail.com>2022-12-30 14:47:25 +0100
commit1c1b02874e1749d61b9b1680f744bf8470147416 (patch)
tree90578f8f7b73792dd41129b71bc73b0eefd81d32 /aports/busybox/CVE-2022-30065.patch
parent1b300a88b562f707ccd1b67229bd878930c9766c (diff)
downloadfreebsd-wifibox-alpine-1c1b02874e1749d61b9b1680f744bf8470147416.zip
Move to Linux 5.15.85 + Alpine 3.17.0.
Diffstat (limited to 'aports/busybox/CVE-2022-30065.patch')
-rw-r--r--aports/busybox/CVE-2022-30065.patch63
1 files changed, 63 insertions, 0 deletions
diff --git a/aports/busybox/CVE-2022-30065.patch b/aports/busybox/CVE-2022-30065.patch
new file mode 100644
index 0000000..4a9cd67
--- /dev/null
+++ b/aports/busybox/CVE-2022-30065.patch
@@ -0,0 +1,63 @@
+From 3c284dcb726ff6599d3b87fb366fb04411cf5595 Mon Sep 17 00:00:00 2001
+From: Natanael Copa <ncopa@alpinelinux.org>
+Date: Fri, 17 Jun 2022 09:52:11 +0000
+Subject: [PATCH 1/2] awk: fix use after free (CVE-2022-30065)
+
+fixes https://bugs.busybox.net/show_bug.cgi?id=14781
+
+Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
+---
+ editors/awk.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/editors/awk.c b/editors/awk.c
+index 079d0bde5..728ee8685 100644
+--- a/editors/awk.c
++++ b/editors/awk.c
+@@ -3128,6 +3128,9 @@ static var *evaluate(node *op, var *res)
+
+ case XC( OC_MOVE ):
+ debug_printf_eval("MOVE\n");
++ /* make sure that we never return a temp var */
++ if (L.v == TMPVAR0)
++ L.v = res;
+ /* if source is a temporary string, jusk relink it to dest */
+ if (R.v == TMPVAR1
+ && !(R.v->type & VF_NUMBER)
+--
+2.36.1
+
+
+From 30c8f8e69230ef27f116a2c10ca2e4a6cc343dad Mon Sep 17 00:00:00 2001
+From: Natanael Copa <ncopa@alpinelinux.org>
+Date: Thu, 16 Jun 2022 21:54:48 +0200
+Subject: [PATCH 2/2] awk: add tests for CVE-2022-30065
+
+Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
+---
+ testsuite/awk.tests | 11 +++++++++++
+ 1 file changed, 11 insertions(+)
+
+diff --git a/testsuite/awk.tests b/testsuite/awk.tests
+index 93e25d8c1..6c3a03c37 100755
+--- a/testsuite/awk.tests
++++ b/testsuite/awk.tests
+@@ -479,4 +479,15 @@ testing 'awk backslash+newline eaten with no trace' \
+ "Hello world\n" \
+ '' ''
+
++testing 'awk use-after-free (CVE-2022-30065)' \
++ "awk '\$3i\$3in\$9=\$r||\$9=i6/6-9f'" \
++ "" \
++ "" \
++ ""
++
++testing 'awk assign while test' \
++ "awk '\$1==\$1=\"foo\" {print \$1}'" \
++ "foo\n" \
++ "" \
++ "foo"
+ exit $FAILCOUNT
+--
+2.36.1
+