summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArchana Polampalli <archana.polampalli@windriver.com>2023-09-05 10:52:39 +0000
committerSteve Sakoman <steve@sakoman.com>2023-09-08 16:09:41 -1000
commitf1de33df8b920c4a48e28797d83b152a7cb0c1c6 (patch)
tree03b9567713f6c8291d583f32e63beba7e7aedd67
parent4eb5af2d8a3beeb14b954118ce3d7e87987368a4 (diff)
downloadpoky-f1de33df8b920c4a48e28797d83b152a7cb0c1c6.tar.gz
nasm: fix CVE-2020-21528
A Segmentation Fault issue discovered in in ieee_segment function in outieee.c in nasm 2.14.03 and 2.15 allows remote attackers to cause a denial of service via crafted assembly file. References: https://nvd.nist.gov/vuln/detail/CVE-2020-21528 Upstream patches: https://github.com/netwide-assembler/nasm/commit/93c774d482694643cafbc82578ac8b729fb5bc8b (From OE-Core rev: 87c4ec2d73ac2e52005e16e38a9a12affb8d51bd) Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
-rw-r--r--meta/recipes-devtools/nasm/nasm/CVE-2020-21528.patch47
-rw-r--r--meta/recipes-devtools/nasm/nasm_2.15.05.bb1
2 files changed, 48 insertions, 0 deletions
diff --git a/meta/recipes-devtools/nasm/nasm/CVE-2020-21528.patch b/meta/recipes-devtools/nasm/nasm/CVE-2020-21528.patch
new file mode 100644
index 0000000000..2303744540
--- /dev/null
+++ b/meta/recipes-devtools/nasm/nasm/CVE-2020-21528.patch
@@ -0,0 +1,47 @@
1From 93c774d482694643cafbc82578ac8b729fb5bc8b Mon Sep 17 00:00:00 2001
2From: Cyrill Gorcunov <gorcunov@gmail.com>
3Date: Wed, 4 Nov 2020 13:08:06 +0300
4Subject: [PATCH] BR3392637: output/outieee: Fix nil dereference
5
6The handling been broken in commit 98578071.
7
8Upstream-Status: Backport [https://github.com/netwide-assembler/nasm/commit/93c774d482694643cafbc82578ac8b729fb5bc8b]
9
10CVE: CVE-2020-21528
11
12Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com>
14---
15 output/outieee.c | 17 +++++++++++++++++
16 1 file changed, 17 insertions(+)
17
18diff --git a/output/outieee.c b/output/outieee.c
19index bff2f085..b3ccc5f6 100644
20--- a/output/outieee.c
21+++ b/output/outieee.c
22@@ -795,6 +795,23 @@ static int32_t ieee_segment(char *name, int *bits)
23 define_label(name, seg->index + 1, 0L, false);
24 ieee_seg_needs_update = NULL;
25
26+ /*
27+ * In commit 98578071b9d71ecaa2344dd9c185237c1765041e
28+ * we reworked labels significantly which in turn lead
29+ * to the case where seg->name = NULL here and we get
30+ * nil dereference in next segments definitions.
31+ *
32+ * Lets placate this case with explicit name setting
33+ * if labels engine didn't set it yet.
34+ *
35+ * FIXME: Need to revisit this moment if such fix doesn't
36+ * break anything but since IEEE 695 format is veeery
37+ * old I don't expect there are many users left. In worst
38+ * case this should only lead to a memory leak.
39+ */
40+ if (!seg->name)
41+ seg->name = nasm_strdup(name);
42+
43 if (seg->use32)
44 *bits = 32;
45 else
46--
472.40.0
diff --git a/meta/recipes-devtools/nasm/nasm_2.15.05.bb b/meta/recipes-devtools/nasm/nasm_2.15.05.bb
index bcb7e071d6..aba061f56f 100644
--- a/meta/recipes-devtools/nasm/nasm_2.15.05.bb
+++ b/meta/recipes-devtools/nasm/nasm_2.15.05.bb
@@ -10,6 +10,7 @@ SRC_URI = "http://www.nasm.us/pub/nasm/releasebuilds/${PV}/nasm-${PV}.tar.bz2 \
10 file://0002-Add-debug-prefix-map-option.patch \ 10 file://0002-Add-debug-prefix-map-option.patch \
11 file://CVE-2022-44370.patch \ 11 file://CVE-2022-44370.patch \
12 file://CVE-2022-46457.patch \ 12 file://CVE-2022-46457.patch \
13 file://CVE-2020-21528.patch \
13 " 14 "
14 15
15SRC_URI[sha256sum] = "3c4b8339e5ab54b1bcb2316101f8985a5da50a3f9e504d43fa6f35668bee2fd0" 16SRC_URI[sha256sum] = "3c4b8339e5ab54b1bcb2316101f8985a5da50a3f9e504d43fa6f35668bee2fd0"