]> code.ossystems Code Review - openembedded-core.git/commitdiff
nasm: fix CVE-2018-1000667
authorHongxu Jia <hongxu.jia@windriver.com>
Tue, 23 Oct 2018 08:35:06 +0000 (04:35 -0400)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 16 Nov 2018 16:32:32 +0000 (16:32 +0000)
Since the latest nasm is  2.14rc16 (not formal release),
so backport a patch to 2.13 to fix CVE-2018-1000667.

(From OE-Core rev: 024b395425c95a08c881d922c310be78ffad483a)

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
meta/recipes-devtools/nasm/nasm/0001-preproc-parse_size-Check-for-string-provided.patch [new file with mode: 0644]
meta/recipes-devtools/nasm/nasm_2.13.03.bb

diff --git a/meta/recipes-devtools/nasm/nasm/0001-preproc-parse_size-Check-for-string-provided.patch b/meta/recipes-devtools/nasm/nasm/0001-preproc-parse_size-Check-for-string-provided.patch
new file mode 100644 (file)
index 0000000..2121fd1
--- /dev/null
@@ -0,0 +1,37 @@
+From a2f43331a853b7cc449cae3361ee1fb54c7fad8d Mon Sep 17 00:00:00 2001
+From: Cyrill Gorcunov <gorcunov@gmail.com>
+Date: Sat, 29 Sep 2018 14:30:14 +0300
+Subject: [PATCH] preproc: parse_size -- Check for string provided
+
+In case if the string is nil we will have sigsegv.
+
+https://bugzilla.nasm.us/show_bug.cgi?id=3392507
+
+Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
+
+CVE: CVE-2018-1000667
+Upstream-Status: Backport
+https://repo.or.cz/nasm/nasm.git/commit/c713b5f994cf7b29164c3b6838b91f0499591434
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ asm/preproc.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/asm/preproc.c b/asm/preproc.c
+index 475926d..1d770a5 100644
+--- a/asm/preproc.c
++++ b/asm/preproc.c
+@@ -2216,8 +2216,7 @@ static int parse_size(const char *str) {
+         { "byte", "dword", "oword", "qword", "tword", "word", "yword" };
+     static const int sizes[] =
+         { 0, 1, 4, 16, 8, 10, 2, 32 };
+-
+-    return sizes[bsii(str, size_names, ARRAY_SIZE(size_names))+1];
++    return str ? sizes[bsii(str, size_names, ARRAY_SIZE(size_names))+1] : 0;
+ }
+ /*
+-- 
+2.8.1
+
index 730db1d8c299d9cd20ce13edf004fa54aca97c12..de4c55446a25577b2f3a6c9eaac5df5efaf5bc0f 100644 (file)
@@ -9,6 +9,7 @@ SRC_URI = "http://www.nasm.us/pub/nasm/releasebuilds/${PV}/nasm-${PV}.tar.bz2 \
            file://0001-fix-CVE-2018-8882.patch \
            file://0001-Verify-that-we-are-not-reading-past-end-of-a-buffer.patch \
            file://0001-eval-Eliminate-division-by-zero.patch \
+           file://0001-preproc-parse_size-Check-for-string-provided.patch \
            "
 
 SRC_URI[md5sum] = "0c581d482f39d5111879ca9601938f74"