summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/nasm/nasm/0001-assemble-Check-global-line-limit.patch
diff options
context:
space:
mode:
authorHongxu Jia <hongxu.jia@windriver.com>2018-08-21 14:30:27 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-08-29 15:23:51 +0100
commit65000da237ac16ac9eee08e6b64830005702ffbf (patch)
tree632b52c6a44dd22dd5c13b39a5dde6ad1d13813a /meta/recipes-devtools/nasm/nasm/0001-assemble-Check-global-line-limit.patch
parent70ab6ebf3e1284e085467f94c069a34532b4b8c9 (diff)
downloadpoky-65000da237ac16ac9eee08e6b64830005702ffbf.tar.gz
nasm: fix CVE-2018-8883 & CVE-2018-8882 & CVE-2018-10316
(From OE-Core rev: 10a52e436d2f9a40c04271bc8aeb04c75fb11383) (From OE-Core rev: 058bdd077da005d412fbbcd98d70fbd80fa80555) 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> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/nasm/nasm/0001-assemble-Check-global-line-limit.patch')
-rw-r--r--meta/recipes-devtools/nasm/nasm/0001-assemble-Check-global-line-limit.patch50
1 files changed, 50 insertions, 0 deletions
diff --git a/meta/recipes-devtools/nasm/nasm/0001-assemble-Check-global-line-limit.patch b/meta/recipes-devtools/nasm/nasm/0001-assemble-Check-global-line-limit.patch
new file mode 100644
index 0000000000..682d4c7277
--- /dev/null
+++ b/meta/recipes-devtools/nasm/nasm/0001-assemble-Check-global-line-limit.patch
@@ -0,0 +1,50 @@
1From 7a46d6b9e3a1d8a0ab0d816ef1bf194ad285e082 Mon Sep 17 00:00:00 2001
2From: "Chang S. Bae" <chang.seok.bae@intel.com>
3Date: Fri, 17 Aug 2018 14:26:03 +0800
4Subject: [PATCH] assemble: Check global line limit
5
6Without the limit, the while loop opens to semi-infinite
7that will exhaustively consume the heap space. Also, the
8index value gets into the garbage.
9
10https://bugzilla.nasm.us/show_bug.cgi?id=3392474
11
12Reported-by : Dongliang Mu <mudongliangabcd@gmail.com>
13Signed-off-by: Chang S. Bae <chang.seok.bae@intel.com>
14Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
15
16Upstream-Status: Backport from upstream [http://repo.or.cz/nasm.git]
17CVE: CVE-2018-10316
18Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
19---
20 asm/nasm.c | 7 ++++++-
21 1 file changed, 6 insertions(+), 1 deletion(-)
22
23diff --git a/asm/nasm.c b/asm/nasm.c
24index 8497ec9..81f6cee 100644
25--- a/asm/nasm.c
26+++ b/asm/nasm.c
27@@ -99,6 +99,8 @@ static char outname[FILENAME_MAX];
28 static char listname[FILENAME_MAX];
29 static char errname[FILENAME_MAX];
30 static int globallineno; /* for forward-reference tracking */
31+#define GLOBALLINENO_MAX INT32_MAX
32+
33 /* static int pass = 0; */
34 const struct ofmt *ofmt = &OF_DEFAULT;
35 const struct ofmt_alias *ofmt_alias = NULL;
36@@ -1360,7 +1362,10 @@ static void assemble_file(char *fname, StrList **depend_ptr)
37 location.offset = offs = get_curr_offs();
38
39 while ((line = preproc->getline())) {
40- globallineno++;
41+ if (globallineno++ == GLOBALLINENO_MAX)
42+ nasm_error(ERR_FATAL,
43+ "overall line number reaches the maximum %d\n",
44+ GLOBALLINENO_MAX);
45
46 /*
47 * Here we parse our directives; this is not handled by the
48--
492.7.4
50