From e8c4ac364b4d0e9f99c18979036ae4105c755902 Mon Sep 17 00:00:00 2001 From: Michael Simacek Date: Tue, 2 Jan 2018 12:31:40 +0100 Subject: [PATCH] Update to upstream version 2.13.02 --- .gitignore | 2 + ...cat-tok-text-if-we-accounted-for-its.patch | 39 --------------- ...oc-Workaround-a-usage-after-free-bug.patch | 47 ------------------- ...en-s-text-if-only-it-has-been-modifi.patch | 29 ------------ nasm.spec | 18 +++---- sources | 4 +- 6 files changed, 14 insertions(+), 125 deletions(-) delete mode 100644 0001-preproc-Only-concat-tok-text-if-we-accounted-for-its.patch delete mode 100644 0002-preproc-Workaround-a-usage-after-free-bug.patch delete mode 100644 0003-preproc-Free-token-s-text-if-only-it-has-been-modifi.patch diff --git a/.gitignore b/.gitignore index ba8a786..959d302 100644 --- a/.gitignore +++ b/.gitignore @@ -50,3 +50,5 @@ nasm-2.08.01-xdoc.tar.bz2 /nasm-2.13-xdoc.tar.bz2 /nasm-2.13.01.tar.bz2 /nasm-2.13.01-xdoc.tar.bz2 +/nasm-2.13.02.tar.bz2 +/nasm-2.13.02-xdoc.tar.bz2 diff --git a/0001-preproc-Only-concat-tok-text-if-we-accounted-for-its.patch b/0001-preproc-Only-concat-tok-text-if-we-accounted-for-its.patch deleted file mode 100644 index 0a5f0c6..0000000 --- a/0001-preproc-Only-concat-tok-text-if-we-accounted-for-its.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 0e8efb23bec14057b21ff7aab280e5a82e1bde30 Mon Sep 17 00:00:00 2001 -From: Adam Majer -Date: Tue, 25 Jul 2017 11:12:35 +0200 -Subject: [PATCH 1/3] preproc: Only concat tok->text if we accounted for its - size - -https://bugzilla.nasm.us/show_bug.cgi?id=3392415 - -Signed-off-by: Adam Majer -Signed-off-by: Cyrill Gorcunov ---- - asm/preproc.c | 10 ++++++++-- - 1 file changed, 8 insertions(+), 2 deletions(-) - -diff --git a/asm/preproc.c b/asm/preproc.c -index 97e87d2c..22c90f2b 100644 ---- a/asm/preproc.c -+++ b/asm/preproc.c -@@ -3845,9 +3845,15 @@ static bool paste_tokens(Token **head, const struct tokseq_match *m, - len += strlen(tok->text); - p = buf = nasm_malloc(len + 1); - -+ strcpy(p, tok->text); -+ p = strchr(p, '\0'); -+ tok = delete_Token(tok); -+ - while (tok != next) { -- strcpy(p, tok->text); -- p = strchr(p, '\0'); -+ if (PP_CONCAT_MATCH(tok, m[i].mask_tail)) { -+ strcpy(p, tok->text); -+ p = strchr(p, '\0'); -+ } - tok = delete_Token(tok); - } - --- -2.13.3 - diff --git a/0002-preproc-Workaround-a-usage-after-free-bug.patch b/0002-preproc-Workaround-a-usage-after-free-bug.patch deleted file mode 100644 index 0a40abf..0000000 --- a/0002-preproc-Workaround-a-usage-after-free-bug.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 35c32162338847b935bc4d2cab7378caeb48e2ca Mon Sep 17 00:00:00 2001 -From: Adam Majer -Date: Tue, 25 Jul 2017 10:42:01 +0200 -Subject: [PATCH 2/3] preproc: Workaround a usage after free bug - -In some circumstantes this free is incorrect resulting -in usage after-free. Workaround it by not freeing memory -here. - -https://bugzilla.nasm.us/show_bug.cgi?id=3392414 - -gorcunov@: - - slightly tuneup the comment - -Signed-off-by: Adam Majer -Signed-off-by: Cyrill Gorcunov ---- - asm/preproc.c | 12 +++++++++++- - 1 file changed, 11 insertions(+), 1 deletion(-) - -diff --git a/asm/preproc.c b/asm/preproc.c -index 22c90f2b..f6e296b4 100644 ---- a/asm/preproc.c -+++ b/asm/preproc.c -@@ -5101,8 +5101,18 @@ static char *pp_getline(void) - nasm_free(m->paramlen); - l->finishes->in_progress = 0; - } -- } else -+ } -+ -+ /* -+ * FIXME It is incorrect to always free_mmacro here. -+ * It leads to usage-after-free. -+ * -+ * https://bugzilla.nasm.us/show_bug.cgi?id=3392414 -+ */ -+#if 0 -+ else - free_mmacro(m); -+#endif - } - istk->expansion = l->next; - nasm_free(l); --- -2.13.3 - diff --git a/0003-preproc-Free-token-s-text-if-only-it-has-been-modifi.patch b/0003-preproc-Free-token-s-text-if-only-it-has-been-modifi.patch deleted file mode 100644 index 71babcd..0000000 --- a/0003-preproc-Free-token-s-text-if-only-it-has-been-modifi.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 3018ceaacf334d0da938c9d3cd35ec8b06b4bf90 Mon Sep 17 00:00:00 2001 -From: Cyrill Gorcunov -Date: Wed, 26 Jul 2017 01:21:16 +0300 -Subject: [PATCH 3/3] preproc: Free token's text if only it has been modified - -https://bugzilla.nasm.us/show_bug.cgi?id=3392414 - -Signed-off-by: Cyrill Gorcunov ---- - asm/preproc.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/asm/preproc.c b/asm/preproc.c -index f6e296b4..0d0e1040 100644 ---- a/asm/preproc.c -+++ b/asm/preproc.c -@@ -1280,8 +1280,8 @@ static char *detoken(Token * tlist, bool expand_locals) - t->text = nasm_zalloc(2); - } else - t->text = nasm_strdup(p); -+ nasm_free(q); - } -- nasm_free(q); - } - - /* Expand local macros here and not during preprocessing */ --- -2.13.3 - diff --git a/nasm.spec b/nasm.spec index f33787f..651f078 100644 --- a/nasm.spec +++ b/nasm.spec @@ -7,15 +7,13 @@ Summary: A portable x86 assembler which uses Intel-like syntax Name: nasm -Version: 2.13.01 -Release: 4%{?dist} +Version: 2.13.02 +Release: 1%{?dist} License: BSD URL: http://www.nasm.us Source0: http://www.nasm.us/pub/nasm/releasebuilds/%{version}/%{name}-%{version}.tar.bz2 Source1: http://www.nasm.us/pub/nasm/releasebuilds/%{version}/%{name}-%{version}-xdoc.tar.bz2 -Patch0: 0001-preproc-Only-concat-tok-text-if-we-accounted-for-its.patch -Patch1: 0002-preproc-Workaround-a-usage-after-free-bug.patch -Patch2: 0003-preproc-Free-token-s-text-if-only-it-has-been-modifi.patch + BuildRequires: perl(Env) BuildRequires: autoconf BuildRequires: asciidoc @@ -57,9 +55,7 @@ include linker, library manager, loader, and information dump. %prep %setup -q -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 + tar xjf %{SOURCE1} --strip-components 1 %build @@ -101,6 +97,12 @@ make INSTALLROOT=$RPM_BUILD_ROOT install install_rdf %{_mandir}/man1/ld* %changelog +* Tue Jan 02 2018 Michael Simacek - 2.13.02-1 +- Update to upstream version 2.13.02 +- Resolves: CVE-2017-17810, CVE-2017-17811, CVE-2017-17812, CVE-2017-17813, + CVE-2017-17814, CVE-2017-17815, CVE-2017-17816, CVE-2017-17817, + CVE-2017-17818, CVE-2017-17819, CVE-2017-17820 + * Thu Aug 03 2017 Fedora Release Engineering - 2.13.01-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild diff --git a/sources b/sources index 2f738b4..ebd7af5 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (nasm-2.13.01.tar.bz2) = 3caf1a3bb9c2f406adce1de37afa92fbf7d7f8d2d274baab08b0e9dc6712c09347fc57d04c3962b6820ad303040efe7e3de0b923c3010c8da00051633bf00c5b -SHA512 (nasm-2.13.01-xdoc.tar.bz2) = b10c0a341af812019cd50fad5c11671dee31675b16e2533a2fdbebdce05532e1c79ffc0b80e3e6d3ecc286c12b12b30c2b3ba576e55c4ef7e60904a346a163d1 +SHA512 (nasm-2.13.02.tar.bz2) = 96b8d66fa15a1a6a78fc4ce88029fb406d9904d1e1b65d42b07914c3128d4dc84b4c986a866204a6f25448b0a5eeaa1d0e1147459769765343ddb6ad73edcc0e +SHA512 (nasm-2.13.02-xdoc.tar.bz2) = 696523f1bdfa9091a80e247dd448bb42392d07dca1cb4f7c9f75cd4f68d81c811034e03b9245fe5cbde1a9947bb3deed0476a9ea4abad87ebad6b0133917ee7a