summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/recipes-devtools/nasm/nasm/0001-fix-pa_add_headers.m4-for-development-versions-of-au.patch28
-rw-r--r--meta/recipes-devtools/nasm/nasm/0001-stdlib-Add-strlcat.patch28
-rw-r--r--meta/recipes-devtools/nasm/nasm/0002-Add-debug-prefix-map-option.patch129
-rw-r--r--meta/recipes-devtools/nasm/nasm/CVE-2018-19755.patch116
-rw-r--r--meta/recipes-devtools/nasm/nasm/CVE-2019-14248.patch43
-rw-r--r--meta/recipes-devtools/nasm/nasm_2.15.03.bb (renamed from meta/recipes-devtools/nasm/nasm_2.14.02.bb)11
6 files changed, 66 insertions, 289 deletions
diff --git a/meta/recipes-devtools/nasm/nasm/0001-fix-pa_add_headers.m4-for-development-versions-of-au.patch b/meta/recipes-devtools/nasm/nasm/0001-fix-pa_add_headers.m4-for-development-versions-of-au.patch
deleted file mode 100644
index b52dc5ba7b..0000000000
--- a/meta/recipes-devtools/nasm/nasm/0001-fix-pa_add_headers.m4-for-development-versions-of-au.patch
+++ /dev/null
@@ -1,28 +0,0 @@
1Upstream-Status: Backport
2Signed-off-by: Ross Burton <ross.burton@arm.com>
3
4From 287964d54b64bed833adba307e1d920f8fcf0cbc Mon Sep 17 00:00:00 2001
5From: Ozkan Sezer <sezero@users.sourceforge.net>
6Date: Wed, 7 Aug 2019 15:50:50 +0300
7Subject: [PATCH] fix pa_add_headers.m4 for development versions of autoconf
8 (bug 3392471)
9
10Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
11---
12 autoconf/m4/pa_add_headers.m4 | 3 ++-
13 1 file changed, 2 insertions(+), 1 deletion(-)
14
15diff --git a/aclocal.m4 b/aclocal.m4
16index 1af2dd5d..6ce3e6c1 100644
17--- a/aclocal.m4
18+++ b/aclocal.m4
19@@ -169,7 +169,8 @@ dnl --------------------------------------------------------------------------
20 AC_DEFUN(_PA_ADD_HEADER,
21 [AC_CHECK_HEADERS([$1],[ac_includes_default="$ac_includes_default
22 #include <$1>"
23-])])
24+])
25+])
26
27 AC_DEFUN(PA_ADD_HEADERS,
28 [m4_map_args_w([$1],[_PA_ADD_HEADER(],[)])])
diff --git a/meta/recipes-devtools/nasm/nasm/0001-stdlib-Add-strlcat.patch b/meta/recipes-devtools/nasm/nasm/0001-stdlib-Add-strlcat.patch
index d94fd3290e..0ede8a8328 100644
--- a/meta/recipes-devtools/nasm/nasm/0001-stdlib-Add-strlcat.patch
+++ b/meta/recipes-devtools/nasm/nasm/0001-stdlib-Add-strlcat.patch
@@ -1,12 +1,13 @@
1From 8a204171004fa0d7d21389530c744d215e99efb0 Mon Sep 17 00:00:00 2001 1From 1c5023002bad3a5b0bbc181fdb324160beace733 Mon Sep 17 00:00:00 2001
2From: Joshua Watt <JPEWhacker@gmail.com> 2From: Joshua Watt <JPEWhacker@gmail.com>
3Date: Tue, 19 Nov 2019 12:47:30 -0600 3Date: Tue, 19 Nov 2019 12:47:30 -0600
4Subject: [PATCH 1/2] stdlib: Add strlcat 4Subject: [PATCH] stdlib: Add strlcat
5 5
6Adds strlcat which can be used to safely concatenate strings 6Adds strlcat which can be used to safely concatenate strings
7 7
8Upstream-Status: Submitted [https://bugzilla.nasm.us/show_bug.cgi?id=3392635] 8Upstream-Status: Submitted [https://bugzilla.nasm.us/show_bug.cgi?id=3392635]
9Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> 9Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
10
10--- 11---
11 Makefile.in | 2 +- 12 Makefile.in | 2 +-
12 configure.ac | 2 ++ 13 configure.ac | 2 ++
@@ -16,10 +17,10 @@ Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
16 create mode 100644 stdlib/strlcat.c 17 create mode 100644 stdlib/strlcat.c
17 18
18diff --git a/Makefile.in b/Makefile.in 19diff --git a/Makefile.in b/Makefile.in
19index 32ef3d91..ff7eb447 100644 20index bfae1f8..156dc4c 100644
20--- a/Makefile.in 21--- a/Makefile.in
21+++ b/Makefile.in 22+++ b/Makefile.in
22@@ -93,7 +93,7 @@ NASM = asm/nasm.$(O) 23@@ -101,7 +101,7 @@ NASM = asm/nasm.$(O)
23 NDISASM = disasm/ndisasm.$(O) 24 NDISASM = disasm/ndisasm.$(O)
24 25
25 LIBOBJ = stdlib/snprintf.$(O) stdlib/vsnprintf.$(O) stdlib/strlcpy.$(O) \ 26 LIBOBJ = stdlib/snprintf.$(O) stdlib/vsnprintf.$(O) stdlib/strlcpy.$(O) \
@@ -27,20 +28,20 @@ index 32ef3d91..ff7eb447 100644
27+ stdlib/strnlen.$(O) stdlib/strrchrnul.$(O) stdlib/strlcat.$(O) \ 28+ stdlib/strnlen.$(O) stdlib/strrchrnul.$(O) stdlib/strlcat.$(O) \
28 \ 29 \
29 nasmlib/ver.$(O) \ 30 nasmlib/ver.$(O) \
30 nasmlib/crc64.$(O) nasmlib/malloc.$(O) nasmlib/errfile.$(O) \ 31 nasmlib/alloc.$(O) nasmlib/asprintf.$(O) nasmlib/errfile.$(O) \
31diff --git a/configure.ac b/configure.ac 32diff --git a/configure.ac b/configure.ac
32index 38b3b596..b4e88778 100644 33index 7b72769..14fd033 100644
33--- a/configure.ac 34--- a/configure.ac
34+++ b/configure.ac 35+++ b/configure.ac
35@@ -152,6 +152,7 @@ AC_CHECK_FUNCS([vsnprintf _vsnprintf]) 36@@ -234,6 +234,7 @@ PA_FUNC_SNPRINTF
36 AC_CHECK_FUNCS([snprintf _snprintf]) 37 PA_FUNC_VSNPRINTF
37 AC_CHECK_FUNCS([strlcpy]) 38 AC_CHECK_FUNCS([strlcpy])
38 AC_CHECK_FUNCS([strrchrnul]) 39 AC_CHECK_FUNCS([strrchrnul])
39+AC_CHECK_FUNCS([strlcat]) 40+AC_CHECK_FUNCS([strlcat])
40 41
41 dnl These types are POSIX-specific, and Windows does it differently... 42 dnl These types are POSIX-specific, and Windows does it differently...
42 AC_CHECK_TYPES([struct _stati64]) 43 AC_CHECK_TYPES([struct _stati64])
43@@ -170,6 +171,7 @@ AC_CHECK_DECLS(strsep) 44@@ -253,6 +254,7 @@ AC_CHECK_DECLS(strsep)
44 AC_CHECK_DECLS(strlcpy) 45 AC_CHECK_DECLS(strlcpy)
45 AC_CHECK_DECLS(strnlen) 46 AC_CHECK_DECLS(strnlen)
46 AC_CHECK_DECLS(strrchrnul) 47 AC_CHECK_DECLS(strrchrnul)
@@ -49,10 +50,10 @@ index 38b3b596..b4e88778 100644
49 dnl Check for missing types 50 dnl Check for missing types
50 AC_TYPE_UINTPTR_T 51 AC_TYPE_UINTPTR_T
51diff --git a/include/compiler.h b/include/compiler.h 52diff --git a/include/compiler.h b/include/compiler.h
52index 4178c98e..8153d297 100644 53index b4fd3a8..7fb4821 100644
53--- a/include/compiler.h 54--- a/include/compiler.h
54+++ b/include/compiler.h 55+++ b/include/compiler.h
55@@ -159,6 +159,10 @@ size_t strlcpy(char *, const char *, size_t); 56@@ -169,6 +169,10 @@ size_t strlcpy(char *, const char *, size_t);
56 char *strrchrnul(const char *, int); 57 char *strrchrnul(const char *, int);
57 #endif 58 #endif
58 59
@@ -65,7 +66,7 @@ index 4178c98e..8153d297 100644
65 # include <stdbool.h> 66 # include <stdbool.h>
66diff --git a/stdlib/strlcat.c b/stdlib/strlcat.c 67diff --git a/stdlib/strlcat.c b/stdlib/strlcat.c
67new file mode 100644 68new file mode 100644
68index 00000000..7084d460 69index 0000000..7084d46
69--- /dev/null 70--- /dev/null
70+++ b/stdlib/strlcat.c 71+++ b/stdlib/strlcat.c
71@@ -0,0 +1,43 @@ 72@@ -0,0 +1,43 @@
@@ -112,6 +113,3 @@ index 00000000..7084d460
112+ 113+
113+#endif 114+#endif
114+ 115+
115--
1162.23.0
117
diff --git a/meta/recipes-devtools/nasm/nasm/0002-Add-debug-prefix-map-option.patch b/meta/recipes-devtools/nasm/nasm/0002-Add-debug-prefix-map-option.patch
index bbfae2e8a5..f788e0fd43 100644
--- a/meta/recipes-devtools/nasm/nasm/0002-Add-debug-prefix-map-option.patch
+++ b/meta/recipes-devtools/nasm/nasm/0002-Add-debug-prefix-map-option.patch
@@ -1,7 +1,7 @@
1From fa677c1caf6b8192971920cf5c1aa8cb33c74605 Mon Sep 17 00:00:00 2001 1From bb4e42ad3a0cdd23a1d1797e6299c76b474867c0 Mon Sep 17 00:00:00 2001
2From: Joshua Watt <JPEWhacker@gmail.com> 2From: Joshua Watt <JPEWhacker@gmail.com>
3Date: Tue, 19 Nov 2019 13:12:17 -0600 3Date: Tue, 19 Nov 2019 13:12:17 -0600
4Subject: [PATCH 2/2] Add --debug-prefix-map option 4Subject: [PATCH] Add --debug-prefix-map option
5 5
6Adds an option to remap file prefixes in output object files. This is 6Adds an option to remap file prefixes in output object files. This is
7analogous to the "-fdebug-prefix-map" option in GCC, and allows files to 7analogous to the "-fdebug-prefix-map" option in GCC, and allows files to
@@ -9,47 +9,48 @@ be built in a reproducible manner regardless of the build directory.
9 9
10Upstream-Status: Submitted [https://bugzilla.nasm.us/show_bug.cgi?id=3392635] 10Upstream-Status: Submitted [https://bugzilla.nasm.us/show_bug.cgi?id=3392635]
11Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> 11Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
12
12--- 13---
13 asm/nasm.c | 28 ++++++++++++++++++++++++++-- 14 asm/nasm.c | 26 +++++++++++++++++++++++++-
14 include/nasmlib.h | 9 +++++++++ 15 include/nasmlib.h | 9 +++++++++
15 nasm.txt | 4 ++++ 16 nasm.txt | 4 ++++
16 nasmlib/filename.c | 20 ++++++++++++++++++++ 17 nasmlib/filename.c | 20 ++++++++++++++++++++
17 output/outas86.c | 4 +++- 18 output/outas86.c | 4 +++-
18 output/outcoff.c | 4 ++-- 19 output/outcoff.c | 4 ++--
19 output/outelf.c | 8 ++++---- 20 output/outelf.c | 2 +-
20 output/outieee.c | 2 +- 21 output/outieee.c | 2 +-
21 output/outobj.c | 2 +- 22 output/outobj.c | 2 +-
22 stdlib/strlcat.c | 2 +- 23 stdlib/strlcat.c | 2 +-
23 test/elfdebugprefix.asm | 6 ++++++ 24 test/elfdebugprefix.asm | 6 ++++++
24 test/performtest.pl | 12 ++++++++++-- 25 test/performtest.pl | 12 ++++++++++--
25 12 files changed, 87 insertions(+), 14 deletions(-) 26 12 files changed, 83 insertions(+), 10 deletions(-)
26 create mode 100644 test/elfdebugprefix.asm 27 create mode 100644 test/elfdebugprefix.asm
27 28
28diff --git a/asm/nasm.c b/asm/nasm.c 29diff --git a/asm/nasm.c b/asm/nasm.c
29index 1c5a5fc5..5d45103c 100644 30index a0e1719..fc6c62e 100644
30--- a/asm/nasm.c 31--- a/asm/nasm.c
31+++ b/asm/nasm.c 32+++ b/asm/nasm.c
32@@ -841,7 +841,8 @@ enum text_options { 33@@ -938,7 +938,8 @@ enum text_options {
33 OPT_BEFORE,
34 OPT_LIMIT, 34 OPT_LIMIT,
35 OPT_KEEP_ALL, 35 OPT_KEEP_ALL,
36- OPT_NO_LINE 36 OPT_NO_LINE,
37+ OPT_NO_LINE, 37- OPT_DEBUG
38+ OPT_DEBUG,
38+ OPT_DEBUG_PREFIX_MAP 39+ OPT_DEBUG_PREFIX_MAP
39 }; 40 };
40 struct textargs { 41 enum need_arg {
41 const char *label; 42 ARG_NO,
42@@ -866,6 +867,7 @@ static const struct textargs textopts[] = { 43@@ -970,6 +971,7 @@ static const struct textargs textopts[] = {
43 {"limit-", OPT_LIMIT, true, 0}, 44 {"keep-all", OPT_KEEP_ALL, ARG_NO, 0},
44 {"keep-all", OPT_KEEP_ALL, false, 0}, 45 {"no-line", OPT_NO_LINE, ARG_NO, 0},
45 {"no-line", OPT_NO_LINE, false, 0}, 46 {"debug", OPT_DEBUG, ARG_MAYBE, 0},
46+ {"debug-prefix-map", OPT_DEBUG_PREFIX_MAP, true, 0}, 47+ {"debug-prefix-map", OPT_DEBUG_PREFIX_MAP, true, 0},
47 {NULL, OPT_BOGUS, false, 0} 48 {NULL, OPT_BOGUS, ARG_NO, 0}
48 }; 49 };
49 50
50@@ -1217,6 +1219,26 @@ static bool process_arg(char *p, char *q, int pass) 51@@ -1332,6 +1334,26 @@ static bool process_arg(char *p, char *q, int pass)
51 case OPT_NO_LINE: 52 case OPT_DEBUG:
52 pp_noline = true; 53 debug_nasm = param ? strtoul(param, NULL, 10) : debug_nasm+1;
53 break; 54 break;
54+ case OPT_DEBUG_PREFIX_MAP: { 55+ case OPT_DEBUG_PREFIX_MAP: {
55+ struct debug_prefix_list *d; 56+ struct debug_prefix_list *d;
@@ -72,24 +73,22 @@ index 1c5a5fc5..5d45103c 100644
72+ } 73+ }
73+ break; 74+ break;
74 case OPT_HELP: 75 case OPT_HELP:
75 help(0); 76 help(stdout);
76 exit(0); 77 exit(0);
77@@ -2010,7 +2032,9 @@ static void help(const char xopt) 78@@ -2297,6 +2319,8 @@ static void help(FILE *out)
78 " --lpostfix str append the given string to all other symbols\n" 79 " -w-x disable warning x (also -Wno-x)\n"
79 " --keep-all output files will not be removed even if an error happens\n" 80 " -w[+-]error promote all warnings to errors (also -Werror)\n"
80 " --no-line ignore %%line directives in input\n" 81 " -w[+-]error=x promote warning x to errors (also -Werror=x)\n"
81- " --limit-X val set execution limit X\n"); 82+ " --debug-prefix-map base=dest\n"
82+ " --limit-X val set execution limit X\n" 83+ " remap paths starting with 'base' to 'dest' in output files\n"
83+ " --debug-prefix-map base=dest\n" 84 , out);
84+ " remap paths starting with 'base' to 'dest' in output files\n");
85 85
86 for (i = 0; i <= LIMIT_MAX; i++) { 86 fprintf(out, " %-20s %s\n",
87 printf(" %-15s %s (default ",
88diff --git a/include/nasmlib.h b/include/nasmlib.h 87diff --git a/include/nasmlib.h b/include/nasmlib.h
89index e57d0e6d..cf921547 100644 88index e9bfbcc..98fc653 100644
90--- a/include/nasmlib.h 89--- a/include/nasmlib.h
91+++ b/include/nasmlib.h 90+++ b/include/nasmlib.h
92@@ -195,10 +195,19 @@ int64_t readstrnum(char *str, int length, bool *warn); 91@@ -250,10 +250,19 @@ int64_t readstrnum(char *str, int length, bool *warn);
93 */ 92 */
94 int32_t seg_alloc(void); 93 int32_t seg_alloc(void);
95 94
@@ -110,7 +109,7 @@ index e57d0e6d..cf921547 100644
110 /* 109 /*
111 * Utility macros... 110 * Utility macros...
112diff --git a/nasm.txt b/nasm.txt 111diff --git a/nasm.txt b/nasm.txt
113index a28202f9..443c06b2 100644 112index cc7fa27..d3485c9 100644
114--- a/nasm.txt 113--- a/nasm.txt
115+++ b/nasm.txt 114+++ b/nasm.txt
116@@ -147,6 +147,10 @@ OPTIONS 115@@ -147,6 +147,10 @@ OPTIONS
@@ -125,7 +124,7 @@ index a28202f9..443c06b2 100644
125 ------ 124 ------
126 This man page does not fully describe the syntax of *nasm*'s assembly language, 125 This man page does not fully describe the syntax of *nasm*'s assembly language,
127diff --git a/nasmlib/filename.c b/nasmlib/filename.c 126diff --git a/nasmlib/filename.c b/nasmlib/filename.c
128index 172ae0bc..fda2be41 100644 127index 172ae0b..fda2be4 100644
129--- a/nasmlib/filename.c 128--- a/nasmlib/filename.c
130+++ b/nasmlib/filename.c 129+++ b/nasmlib/filename.c
131@@ -39,6 +39,8 @@ 130@@ -39,6 +39,8 @@
@@ -160,10 +159,10 @@ index 172ae0bc..fda2be41 100644
160+ return dest; 159+ return dest;
161+} 160+}
162diff --git a/output/outas86.c b/output/outas86.c 161diff --git a/output/outas86.c b/output/outas86.c
163index 3f9867b9..d5f4f966 100644 162index 54b22f8..c4a412c 100644
164--- a/output/outas86.c 163--- a/output/outas86.c
165+++ b/output/outas86.c 164+++ b/output/outas86.c
166@@ -113,6 +113,8 @@ static void as86_sect_write(struct Section *, const uint8_t *, 165@@ -110,6 +110,8 @@ static void as86_sect_write(struct Section *, const uint8_t *,
167 166
168 static void as86_init(void) 167 static void as86_init(void)
169 { 168 {
@@ -172,7 +171,7 @@ index 3f9867b9..d5f4f966 100644
172 stext.data = saa_init(1L); 171 stext.data = saa_init(1L);
173 stext.datalen = 0L; 172 stext.datalen = 0L;
174 stext.head = stext.last = NULL; 173 stext.head = stext.last = NULL;
175@@ -134,7 +136,7 @@ static void as86_init(void) 174@@ -131,7 +133,7 @@ static void as86_init(void)
176 strslen = 0; 175 strslen = 0;
177 176
178 /* as86 module name = input file minus extension */ 177 /* as86 module name = input file minus extension */
@@ -182,10 +181,10 @@ index 3f9867b9..d5f4f966 100644
182 181
183 static void as86_cleanup(void) 182 static void as86_cleanup(void)
184diff --git a/output/outcoff.c b/output/outcoff.c 183diff --git a/output/outcoff.c b/output/outcoff.c
185index a2fd302c..bcf576fb 100644 184index bcd9ff3..15bfcf3 100644
186--- a/output/outcoff.c 185--- a/output/outcoff.c
187+++ b/output/outcoff.c 186+++ b/output/outcoff.c
188@@ -1070,14 +1070,14 @@ static void coff_symbol(char *name, int32_t strpos, int32_t value, 187@@ -1095,14 +1095,14 @@ static void coff_symbol(char *name, int32_t strpos, int32_t value,
189 188
190 static void coff_write_symbols(void) 189 static void coff_write_symbols(void)
191 { 190 {
@@ -203,48 +202,23 @@ index a2fd302c..bcf576fb 100644
203 202
204 /* 203 /*
205diff --git a/output/outelf.c b/output/outelf.c 204diff --git a/output/outelf.c b/output/outelf.c
206index de99d076..203b5dc0 100644 205index 61af020..1292958 100644
207--- a/output/outelf.c 206--- a/output/outelf.c
208+++ b/output/outelf.c 207+++ b/output/outelf.c
209@@ -1,5 +1,5 @@ 208@@ -553,7 +553,7 @@ static void elf_init(void)
210 /* ----------------------------------------------------------------------- * 209 };
211- * 210 const char * const *p;
212+ *
213 * Copyright 1996-2017 The NASM Authors - All Rights Reserved
214 * See the file AUTHORS included with the NASM distribution for
215 * the specific copyright holders.
216@@ -14,7 +14,7 @@
217 * copyright notice, this list of conditions and the following
218 * disclaimer in the documentation and/or other materials provided
219 * with the distribution.
220- *
221+ *
222 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
223 * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
224 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
225@@ -315,7 +315,7 @@ elf_directive(enum directive directive, char *value, int pass)
226 211
227 static void elf_init(void)
228 {
229- strlcpy(elf_module, inname, sizeof(elf_module)); 212- strlcpy(elf_module, inname, sizeof(elf_module));
230+ filename_debug_remap(elf_module, inname, sizeof(elf_module)); 213+ filename_debug_remap(elf_module, inname, sizeof(elf_module));
231 sects = NULL; 214 sects = NULL;
232 nsects = sectlen = 0; 215 nsects = sectlen = 0;
233 syms = saa_init((int32_t)sizeof(struct elf_symbol)); 216 syms = saa_init((int32_t)sizeof(struct elf_symbol));
234@@ -868,7 +868,7 @@ static void elf32_out(int32_t segto, const void *data,
235 " segment base references");
236 } else {
237 if (wrt == NO_SEG) {
238- /*
239+ /*
240 * The if() is a hack to deal with compilers which
241 * don't handle switch() statements with 64-bit
242 * expressions.
243diff --git a/output/outieee.c b/output/outieee.c 217diff --git a/output/outieee.c b/output/outieee.c
244index 3a28942d..f61824e4 100644 218index 4cc0f0f..2468724 100644
245--- a/output/outieee.c 219--- a/output/outieee.c
246+++ b/output/outieee.c 220+++ b/output/outieee.c
247@@ -209,7 +209,7 @@ static void ieee_unqualified_name(char *, char *); 221@@ -207,7 +207,7 @@ static void ieee_unqualified_name(char *, char *);
248 */ 222 */
249 static void ieee_init(void) 223 static void ieee_init(void)
250 { 224 {
@@ -254,10 +228,10 @@ index 3a28942d..f61824e4 100644
254 fpubhead = NULL; 228 fpubhead = NULL;
255 fpubtail = &fpubhead; 229 fpubtail = &fpubhead;
256diff --git a/output/outobj.c b/output/outobj.c 230diff --git a/output/outobj.c b/output/outobj.c
257index b4f2c499..55bba4a1 100644 231index 0d4d311..d8dd6a0 100644
258--- a/output/outobj.c 232--- a/output/outobj.c
259+++ b/output/outobj.c 233+++ b/output/outobj.c
260@@ -640,7 +640,7 @@ static enum directive_result obj_directive(enum directive, char *, int); 234@@ -638,7 +638,7 @@ static enum directive_result obj_directive(enum directive, char *);
261 235
262 static void obj_init(void) 236 static void obj_init(void)
263 { 237 {
@@ -267,7 +241,7 @@ index b4f2c499..55bba4a1 100644
267 any_segs = false; 241 any_segs = false;
268 fpubhead = NULL; 242 fpubhead = NULL;
269diff --git a/stdlib/strlcat.c b/stdlib/strlcat.c 243diff --git a/stdlib/strlcat.c b/stdlib/strlcat.c
270index 7084d460..ee93dea3 100644 244index 7084d46..ee93dea 100644
271--- a/stdlib/strlcat.c 245--- a/stdlib/strlcat.c
272+++ b/stdlib/strlcat.c 246+++ b/stdlib/strlcat.c
273@@ -29,7 +29,7 @@ size_t strlcat(char *dest, const char *src, size_t size) 247@@ -29,7 +29,7 @@ size_t strlcat(char *dest, const char *src, size_t size)
@@ -281,7 +255,7 @@ index 7084d460..ee93dea3 100644
281 /* destination was not NULL terminated. Return the initial size */ 255 /* destination was not NULL terminated. Return the initial size */
282diff --git a/test/elfdebugprefix.asm b/test/elfdebugprefix.asm 256diff --git a/test/elfdebugprefix.asm b/test/elfdebugprefix.asm
283new file mode 100644 257new file mode 100644
284index 00000000..a67ba29c 258index 0000000..a67ba29
285--- /dev/null 259--- /dev/null
286+++ b/test/elfdebugprefix.asm 260+++ b/test/elfdebugprefix.asm
287@@ -0,0 +1,6 @@ 261@@ -0,0 +1,6 @@
@@ -292,7 +266,7 @@ index 00000000..a67ba29c
292+ ret 266+ ret
293+ 267+
294diff --git a/test/performtest.pl b/test/performtest.pl 268diff --git a/test/performtest.pl b/test/performtest.pl
295index f7865b39..096f9604 100755 269index f7865b3..096f960 100755
296--- a/test/performtest.pl 270--- a/test/performtest.pl
297+++ b/test/performtest.pl 271+++ b/test/performtest.pl
298@@ -42,14 +42,22 @@ sub perform { 272@@ -42,14 +42,22 @@ sub perform {
@@ -320,6 +294,3 @@ index f7865b39..096f9604 100755
320 #Move the output to the test dir 294 #Move the output to the test dir
321 mkpath("$outputdir/$testname/$subname"); 295 mkpath("$outputdir/$testname/$subname");
322 foreach(split / /,$files) { 296 foreach(split / /,$files) {
323--
3242.23.0
325
diff --git a/meta/recipes-devtools/nasm/nasm/CVE-2018-19755.patch b/meta/recipes-devtools/nasm/nasm/CVE-2018-19755.patch
deleted file mode 100644
index 6e3f909d0f..0000000000
--- a/meta/recipes-devtools/nasm/nasm/CVE-2018-19755.patch
+++ /dev/null
@@ -1,116 +0,0 @@
1From 3079f7966dbed4497e36d5067cbfd896a90358cb Mon Sep 17 00:00:00 2001
2From: Cyrill Gorcunov <gorcunov@gmail.com>
3Date: Wed, 14 Nov 2018 10:03:42 +0300
4Subject: [PATCH] preproc: Fix malformed parameter count
5
6readnum returns 64bit number which may become
7a negative integer upon conversion which in
8turn lead to out of bound array access.
9
10Fix it by explicit conversion with bounds check
11
12 | POC6:2: error: parameter count `2222222222' is out of bounds [0; 2147483647]
13
14https://bugzilla.nasm.us/show_bug.cgi?id=3392528
15
16Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
17
18Upstream-Status: Backport
19CVE: CVE-2018-19755
20Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
21---
22 asm/preproc.c | 43 +++++++++++++++++++++----------------------
23 1 file changed, 21 insertions(+), 22 deletions(-)
24
25diff --git a/asm/preproc.c b/asm/preproc.c
26index b6afee3..e5ad05a 100644
27--- a/asm/preproc.c
28+++ b/asm/preproc.c
29@@ -1650,6 +1650,23 @@ smacro_defined(Context * ctx, const char *name, int nparam, SMacro ** defn,
30 return false;
31 }
32
33+/* param should be a natural number [0; INT_MAX] */
34+static int read_param_count(const char *str)
35+{
36+ int result;
37+ bool err;
38+
39+ result = readnum(str, &err);
40+ if (result < 0 || result > INT_MAX) {
41+ result = 0;
42+ nasm_error(ERR_NONFATAL, "parameter count `%s' is out of bounds [%d; %d]",
43+ str, 0, INT_MAX);
44+ } else if (err) {
45+ nasm_error(ERR_NONFATAL, "unable to parse parameter count `%s'", str);
46+ }
47+ return result;
48+}
49+
50 /*
51 * Count and mark off the parameters in a multi-line macro call.
52 * This is called both from within the multi-line macro expansion
53@@ -1871,11 +1888,7 @@ static bool if_condition(Token * tline, enum preproc_token ct)
54 pp_directives[ct]);
55 } else {
56 searching.nparam_min = searching.nparam_max =
57- readnum(tline->text, &j);
58- if (j)
59- nasm_error(ERR_NONFATAL,
60- "unable to parse parameter count `%s'",
61- tline->text);
62+ read_param_count(tline->text);
63 }
64 if (tline && tok_is_(tline->next, "-")) {
65 tline = tline->next->next;
66@@ -1886,11 +1899,7 @@ static bool if_condition(Token * tline, enum preproc_token ct)
67 "`%s' expects a parameter count after `-'",
68 pp_directives[ct]);
69 else {
70- searching.nparam_max = readnum(tline->text, &j);
71- if (j)
72- nasm_error(ERR_NONFATAL,
73- "unable to parse parameter count `%s'",
74- tline->text);
75+ searching.nparam_max = read_param_count(tline->text);
76 if (searching.nparam_min > searching.nparam_max) {
77 nasm_error(ERR_NONFATAL,
78 "minimum parameter count exceeds maximum");
79@@ -2079,8 +2088,6 @@ static void undef_smacro(Context *ctx, const char *mname)
80 */
81 static bool parse_mmacro_spec(Token *tline, MMacro *def, const char *directive)
82 {
83- bool err;
84-
85 tline = tline->next;
86 skip_white_(tline);
87 tline = expand_id(tline);
88@@ -2103,11 +2110,7 @@ static bool parse_mmacro_spec(Token *tline, MMacro *def, const char *directive)
89 if (!tok_type_(tline, TOK_NUMBER)) {
90 nasm_error(ERR_NONFATAL, "`%s' expects a parameter count", directive);
91 } else {
92- def->nparam_min = def->nparam_max =
93- readnum(tline->text, &err);
94- if (err)
95- nasm_error(ERR_NONFATAL,
96- "unable to parse parameter count `%s'", tline->text);
97+ def->nparam_min = def->nparam_max = read_param_count(tline->text);
98 }
99 if (tline && tok_is_(tline->next, "-")) {
100 tline = tline->next->next;
101@@ -2117,11 +2120,7 @@ static bool parse_mmacro_spec(Token *tline, MMacro *def, const char *directive)
102 nasm_error(ERR_NONFATAL,
103 "`%s' expects a parameter count after `-'", directive);
104 } else {
105- def->nparam_max = readnum(tline->text, &err);
106- if (err) {
107- nasm_error(ERR_NONFATAL, "unable to parse parameter count `%s'",
108- tline->text);
109- }
110+ def->nparam_max = read_param_count(tline->text);
111 if (def->nparam_min > def->nparam_max) {
112 nasm_error(ERR_NONFATAL, "minimum parameter count exceeds maximum");
113 def->nparam_max = def->nparam_min;
114--
1152.10.5.GIT
116
diff --git a/meta/recipes-devtools/nasm/nasm/CVE-2019-14248.patch b/meta/recipes-devtools/nasm/nasm/CVE-2019-14248.patch
deleted file mode 100644
index d45d2cb465..0000000000
--- a/meta/recipes-devtools/nasm/nasm/CVE-2019-14248.patch
+++ /dev/null
@@ -1,43 +0,0 @@
1From 93d41d82963b2cfd0b24c906f5a8daf53281b559 Mon Sep 17 00:00:00 2001
2From: "H. Peter Anvin (Intel)" <hpa@zytor.com>
3Date: Fri, 16 Aug 2019 01:12:54 -0700
4Subject: [PATCH] BR 3392576: don't segfault on a bad %pragma limit
5
6Don't segfault on a bad %pragma limit. Instead treat a NULL pointer as
7an empty string.
8
9Reported-by: Ren Kimura <rkx1209dev@gmail.com>
10Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
11
12CVE: CVE-2019-14248
13Upstream-Status: Backport [https://repo.or.cz/nasm.git/commit/93d41d82963b2cfd0b24c906f5a8daf53281b559]
14Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
15---
16 asm/nasm.c | 7 ++++++-
17 1 file changed, 6 insertions(+), 1 deletion(-)
18
19diff --git a/asm/nasm.c b/asm/nasm.c
20index c84d675..65116ab 100644
21--- a/asm/nasm.c
22+++ b/asm/nasm.c
23@@ -212,6 +212,11 @@ nasm_set_limit(const char *limit, const char *valstr)
24 bool rn_error;
25 int errlevel;
26
27+ if (!limit)
28+ limit = "";
29+ if (!valstr)
30+ valstr = "";
31+
32 for (i = 0; i <= LIMIT_MAX; i++) {
33 if (!nasm_stricmp(limit, limit_info[i].name))
34 break;
35@@ -204,7 +209,7 @@ nasm_set_limit(const char *limit, const char *valstr)
36 errlevel = ERR_WARNING|ERR_NOFILE|ERR_USAGE;
37 else
38 errlevel = ERR_WARNING|ERR_PASS1|WARN_UNKNOWN_PRAGMA;
39- nasm_error(errlevel, "unknown limit: `%s'", limit);
40+ nasm_error(errlevel, "invalid limit value: `%s'", valstr);
41 return DIRR_ERROR;
42 }
43
diff --git a/meta/recipes-devtools/nasm/nasm_2.14.02.bb b/meta/recipes-devtools/nasm/nasm_2.15.03.bb
index c40be8fbbf..5c4e28de06 100644
--- a/meta/recipes-devtools/nasm/nasm_2.14.02.bb
+++ b/meta/recipes-devtools/nasm/nasm_2.15.03.bb
@@ -4,20 +4,15 @@ LICENSE = "BSD-2-Clause"
4LIC_FILES_CHKSUM = "file://LICENSE;md5=90904486f8fbf1861cf42752e1a39efe" 4LIC_FILES_CHKSUM = "file://LICENSE;md5=90904486f8fbf1861cf42752e1a39efe"
5 5
6SRC_URI = "http://www.nasm.us/pub/nasm/releasebuilds/${PV}/nasm-${PV}.tar.bz2 \ 6SRC_URI = "http://www.nasm.us/pub/nasm/releasebuilds/${PV}/nasm-${PV}.tar.bz2 \
7 file://CVE-2018-19755.patch \
8 file://CVE-2019-14248.patch \
9 file://0001-stdlib-Add-strlcat.patch \ 7 file://0001-stdlib-Add-strlcat.patch \
10 file://0002-Add-debug-prefix-map-option.patch \ 8 file://0002-Add-debug-prefix-map-option.patch \
11 file://0001-fix-pa_add_headers.m4-for-development-versions-of-au.patch \
12 " 9 "
13 10
14SRC_URI[md5sum] = "3f489aa48ad2aa1f967dc5e293bbd06f" 11SRC_URI[sha256sum] = "04e7343d9bf112bffa9fda86f6c7c8b120c2ccd700b882e2db9f57484b1bd778"
15SRC_URI[sha256sum] = "34fd26c70a277a9fdd54cb5ecf389badedaf48047b269d1008fbc819b24e80bc"
16 12
17# brokensep since this uses autoconf but not automake 13EXTRA_AUTORECONF_append = " -I autoconf/m4"
18inherit autotools-brokensep
19 14
20EXTRA_AUTORECONF += "--exclude=aclocal" 15inherit autotools
21 16
22BBCLASSEXTEND = "native" 17BBCLASSEXTEND = "native"
23 18