diff --git a/CVE-2022-44370.patch b/CVE-2022-44370.patch deleted file mode 100644 index 30aba0b65ea12b411000701d1235a363e6ff4bc3..0000000000000000000000000000000000000000 --- a/CVE-2022-44370.patch +++ /dev/null @@ -1,94 +0,0 @@ -From 2d4e6952417ec6f08b6f135d2b5d0e19b7dae30d Mon Sep 17 00:00:00 2001 -From: "H. Peter Anvin" -Date: Mon, 7 Nov 2022 10:26:03 -0800 -Subject: [PATCH] quote_for_pmake: fix counter underrun resulting in segfault - -while (nbs--) { ... } ends with nbs == -1. Rather than a minimal fix, -introduce mempset() to make these kinds of errors less likely in the -future. - -Fixes: https://bugzilla.nasm.us/show_bug.cgi?id=3392815 -Reported-by: <13579and24680@gmail.com> -Signed-off-by: H. Peter Anvin ---- - asm/nasm.c | 12 +++++------- - configure.ac | 1 + - include/compiler.h | 7 +++++++ - 3 files changed, 13 insertions(+), 7 deletions(-) - -diff --git a/asm/nasm.c b/asm/nasm.c -index 6af927547..1e337c7ba 100644 ---- a/asm/nasm.c -+++ b/asm/nasm.c -@@ -1,6 +1,6 @@ - /* ----------------------------------------------------------------------- * - * -- * Copyright 1996-2020 The NASM Authors - All Rights Reserved -+ * Copyright 1996-2022 The NASM Authors - All Rights Reserved - * See the file AUTHORS included with the NASM distribution for - * the specific copyright holders. - * -@@ -817,8 +817,7 @@ static char *quote_for_pmake(const char *str) - } - - /* Convert N backslashes at the end of filename to 2N backslashes */ -- if (nbs) -- n += nbs; -+ n += nbs; - - os = q = nasm_malloc(n); - -@@ -827,10 +826,10 @@ static char *quote_for_pmake(const char *str) - switch (*p) { - case ' ': - case '\t': -- while (nbs--) -- *q++ = '\\'; -+ q = mempset(q, '\\', nbs); - *q++ = '\\'; - *q++ = *p; -+ nbs = 0; - break; - case '$': - *q++ = *p; -@@ -852,9 +851,8 @@ static char *quote_for_pmake(const char *str) - break; - } - } -- while (nbs--) -- *q++ = '\\'; - -+ q = mempset(q, '\\', nbs); - *q = '\0'; - - return os; -diff --git a/configure.ac b/configure.ac -index 04a9f648b..42cd19884 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -200,6 +200,7 @@ AC_CHECK_FUNCS(strrchrnul) - AC_CHECK_FUNCS(iscntrl) - AC_CHECK_FUNCS(isascii) - AC_CHECK_FUNCS(mempcpy) -+AC_CHECK_FUNCS(mempset) - - AC_CHECK_FUNCS(getuid) - AC_CHECK_FUNCS(getgid) -diff --git a/include/compiler.h b/include/compiler.h -index c5bac6e57..407c16093 100644 ---- a/include/compiler.h -+++ b/include/compiler.h -@@ -252,6 +252,13 @@ static inline void *mempcpy(void *dst, const void *src, size_t n) - } - #endif - -+#ifndef HAVE_MEMPSET -+static inline void *mempset(void *dst, int c, size_t n) -+{ -+ return (char *)memset(dst, c, n) + n; -+} -+#endif -+ - /* - * Hack to support external-linkage inline functions - */ diff --git a/enable-make-check.patch b/enable-make-check.patch index 3988ffda8b2309ebc480249fc238a8677dc633ba..224d2998a9a6aff5a9de5438bd260493287f8d6f 100644 --- a/enable-make-check.patch +++ b/enable-make-check.patch @@ -12,18 +12,18 @@ diff --git a/Makefile.in b/Makefile.in index 5725ed3..9282215 100644 --- a/Makefile.in +++ b/Makefile.in -@@ -497,10 +497,10 @@ splint: +@@ -459,10 +459,10 @@ splint -weak *.c - test: nasm$(X) + test: $(PROGS) - cd test && $(RUNPERL) performtest.pl --nasm=../nasm *.asm + cd test && $(RUNPERL) performtest.pl --nasm=../nasm *.asm --verbose - golden: nasm$(X) + golden: $(PROGS) - cd test && $(RUNPERL) performtest.pl --golden --nasm=../nasm *.asm + cd test && $(RUNPERL) performtest.pl --golden --nasm=../nasm *.asm --verbose - travis: nasm$(X) + travis: $(PROGS) $(PYTHON3) travis/nasm-t.py run -- 2.23.0 diff --git a/nasm-2.15.05-xdoc.tar.bz2 b/nasm-2.15.05-xdoc.tar.bz2 deleted file mode 100644 index 28b35a88460b54e683e4809aa2ededca2f791597..0000000000000000000000000000000000000000 Binary files a/nasm-2.15.05-xdoc.tar.bz2 and /dev/null differ diff --git a/nasm-2.15.05.tar.bz2 b/nasm-2.15.05.tar.bz2 deleted file mode 100644 index b41bc46e4dc95aa9a1595b18bf1bd2ff52cb1d8d..0000000000000000000000000000000000000000 Binary files a/nasm-2.15.05.tar.bz2 and /dev/null differ diff --git a/nasm-2.16.01-xdoc.tar.xz b/nasm-2.16.01-xdoc.tar.xz new file mode 100644 index 0000000000000000000000000000000000000000..fd398a127b935ae12b12a2c01a105856458daf50 Binary files /dev/null and b/nasm-2.16.01-xdoc.tar.xz differ diff --git a/nasm-2.16.01.tar.xz b/nasm-2.16.01.tar.xz new file mode 100644 index 0000000000000000000000000000000000000000..128cfdd68b90c9484a3414cceae4d9fe5db1050c Binary files /dev/null and b/nasm-2.16.01.tar.xz differ diff --git a/nasm.spec b/nasm.spec index af15bc7a9205bf6f8ad0624d672ad1063068ec3d..b4ea0d249b7c73880eddc901b2a7c32ec9932117 100644 --- a/nasm.spec +++ b/nasm.spec @@ -7,23 +7,19 @@ %endif Name: nasm -Version: 2.15.05 -Release: 5 +Version: 2.16.01 +Release: 1 Summary: The Netwide Assembler, a portable x86 assembler with Intel-like syntax License: BSD-2-Clause 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 +Source0: http://www.nasm.us/pub/nasm/releasebuilds/%{version}/%{name}-%{version}.tar.xz +Source1: http://www.nasm.us/pub/nasm/releasebuilds/%{version}/%{name}-%{version}-xdoc.tar.xz Patch6000: enable-make-check.patch Patch6001: fix-help-info-error.patch -# https://github.com/netwide-assembler/nasm/commit/2d4e6952417ec6f08b6f135d2b5d0e19b7dae30d -Patch6002: CVE-2022-44370.patch -#https://bugzilla.nasm.us/attachment.cgi?id=411648 -BuildRequires: perl(Env) autoconf asciidoc xmlto gcc make git -Provides: %{name}-rdoff -Obsoletes: %{name}-rdoff +BuildRequires: perl(Env) autoconf asciidoc xmlto gcc make git automake +Obsoletes: nasm-rdoff < 2.16.01-1 %description NASM is the Netwide Assembler, a free portable assembler for the Intel @@ -35,7 +31,7 @@ format, includes linker, library manager, loader, and information dump. Summary: Help files for NASM %if %{with documentation} BuildRequires: perl(Font::TTF::Font) perl(File::Spec) -BuildRequires: perl(Sort::Versions) +BuildRequires: perl(Sort::Versions) perl(sort) BuildRequires: adobe-source-sans-pro-fonts adobe-source-code-pro-fonts BuildRequires: ghostscript Provides: %{name}-doc @@ -49,6 +45,7 @@ and text formats. %prep %autosetup -n %{name}-%{version} -p1 +tar xJf %{SOURCE1} --strip-components 1 %build %configure @@ -60,7 +57,7 @@ make all %{?_smp_mflags} %endif %install -%make_install install_rdf +%make_install %check make golden @@ -68,18 +65,9 @@ make test %files %doc CHANGES README.md -%license AUTHORS +%license AUTHORS LICENSE %{_bindir}/nasm %{_bindir}/ndisasm -%{_bindir}/ldrdf -%{_bindir}/rdf2bin -%{_bindir}/rdf2ihx -%{_bindir}/rdf2com -%{_bindir}/rdfdump -%{_bindir}/rdflib -%{_bindir}/rdx -%{_bindir}/rdf2ith -%{_bindir}/rdf2srec %files help %if %{with documentation} @@ -87,10 +75,11 @@ make test %endif %{_mandir}/man1/nasm* %{_mandir}/man1/ndisasm* -%{_mandir}/man1/rd* -%{_mandir}/man1/ld* %changelog +* Thu May 18 2023 liyanan - 2.16.01-1 +- update to 2.16.01 + * Wed Apr 12 2023 yaoxin - 2.15.05-5 - Fix CVE-2022-44370