aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSoumya <soumya.sambu@windriver.com>2023-08-18 14:38:04 +0000
committerArmin Kuster <akuster808@gmail.com>2024-01-12 07:14:16 -0500
commit7f5ded2c880947f6866509ea19a49ca4fe5e0357 (patch)
treeccb32ef3f517b80e560fe1d43c337ac1fab73255
parent402affcc073db39f782c1ebfd718edd5f11eed4c (diff)
downloadmeta-openembedded-contrib-7f5ded2c880947f6866509ea19a49ca4fe5e0357.tar.gz
yasm: fix CVE-2023-37732
Yasm v1.3.0.78 was found prone to NULL Pointer Dereference in /libyasm/intnum.c and /elf/elf.c, which allows the attacker to cause a denial of service via a crafted file. References: https://github.com/yasm/yasm/issues/233 https://nvd.nist.gov/vuln/detail/CVE-2023-37732 Signed-off-by: Soumya <soumya.sambu@windriver.com> Signed-off-by: Armin Kuster <akuster808@gmail.com> (cherry picked from commit 41fffef6b044b2722aa13f7e7648a3f848231851) Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r--meta-oe/recipes-devtools/yasm/yasm/CVE-2023-37732.patch41
-rw-r--r--meta-oe/recipes-devtools/yasm/yasm_git.bb1
2 files changed, 42 insertions, 0 deletions
diff --git a/meta-oe/recipes-devtools/yasm/yasm/CVE-2023-37732.patch b/meta-oe/recipes-devtools/yasm/yasm/CVE-2023-37732.patch
new file mode 100644
index 0000000000..1ca33f0a92
--- /dev/null
+++ b/meta-oe/recipes-devtools/yasm/yasm/CVE-2023-37732.patch
@@ -0,0 +1,41 @@
+From 2cd3bb50e256f5ed5f611ac611d25fe673f2cec3 Mon Sep 17 00:00:00 2001
+From: Peter Johnson <johnson.peter@gmail.com>
+Date: Fri, 11 Aug 2023 10:49:51 +0000
+Subject: [PATCH] elf.c: Fix NULL deref on bad xsize expression (#234)
+
+CVE: CVE-2023-37732
+
+Upstream-Status: Backport [https://github.com/yasm/yasm/commit/2cd3bb50e256f5ed5f611ac611d25fe673f2cec3]
+
+Signed-off-by: Soumya <soumya.sambu@windriver.com>
+---
+ modules/objfmts/elf/elf.c | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/modules/objfmts/elf/elf.c b/modules/objfmts/elf/elf.c
+index 2486bba8..bab4c9ca 100644
+--- a/modules/objfmts/elf/elf.c
++++ b/modules/objfmts/elf/elf.c
+@@ -482,15 +482,15 @@ elf_symtab_write_to_file(FILE *f, elf_symtab_head *symtab,
+
+ /* get size (if specified); expr overrides stored integer */
+ if (entry->xsize) {
+- size_intn = yasm_intnum_copy(
+- yasm_expr_get_intnum(&entry->xsize, 1));
+- if (!size_intn) {
++ yasm_intnum *intn = yasm_expr_get_intnum(&entry->xsize, 1);
++ if (!intn) {
+ yasm_error_set(YASM_ERROR_VALUE,
+ N_("size specifier not an integer expression"));
+ yasm_errwarn_propagate(errwarns, entry->xsize->line);
+- }
++ } else
++ size_intn = yasm_intnum_copy(intn);
+ }
+- else
++ if (!size_intn)
+ size_intn = yasm_intnum_create_uint(entry->size);
+
+ /* get EQU value for constants */
+--
+2.40.0
diff --git a/meta-oe/recipes-devtools/yasm/yasm_git.bb b/meta-oe/recipes-devtools/yasm/yasm_git.bb
index 5c3562300b..60b00f7ff4 100644
--- a/meta-oe/recipes-devtools/yasm/yasm_git.bb
+++ b/meta-oe/recipes-devtools/yasm/yasm_git.bb
@@ -12,6 +12,7 @@ SRCREV = "ba463d3c26c0ece2e797b8d6381b161633b5971a"
SRC_URI = "git://github.com/yasm/yasm.git;branch=master;protocol=https \
file://0001-Do-not-use-AC_HEADER_STDC.patch \
file://CVE-2023-31975.patch \
+ file://CVE-2023-37732.patch \
"
S = "${WORKDIR}/git"