diff --git a/CVE-2023-38665.patch b/CVE-2023-38665.patch new file mode 100644 index 0000000000000000000000000000000000000000..5068a1fe1c4c3c443985322a7ebca20f5f530857 --- /dev/null +++ b/CVE-2023-38665.patch @@ -0,0 +1,54 @@ +From c8af73112027fad0ecbb277e9cba257678c405af Mon Sep 17 00:00:00 2001 +From: "H. Peter Anvin" +Date: Wed, 7 Dec 2022 10:23:46 -0800 +Subject: [PATCH] outieee: fix segfault on empty input + +Fix the IEEE backend crashing if the input file is empty. + +Signed-off-by: H. Peter Anvin +--- + output/outieee.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/output/outieee.c b/output/outieee.c +index 878a17a4..7ba90366 100644 +--- a/output/outieee.c ++++ b/output/outieee.c +@@ -1,6 +1,6 @@ + /* ----------------------------------------------------------------------- * + * +- * Copyright 1996-2016 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. + * +@@ -936,7 +936,7 @@ static void ieee_write_file(void) + * Write the section headers + */ + seg = seghead; +- if (!debuginfo && !strcmp(seg->name, "??LINE")) ++ if (!debuginfo && seg && !strcmp(seg->name, "??LINE")) + seg = seg->next; + while (seg) { + char buf[256]; +@@ -971,7 +971,7 @@ static void ieee_write_file(void) + /* + * write the start address if there is one + */ +- if (ieee_entry_seg) { ++ if (ieee_entry_seg && seghead) { + for (seg = seghead; seg; seg = seg->next) + if (seg->index == ieee_entry_seg) + break; +@@ -1084,7 +1084,7 @@ static void ieee_write_file(void) + * put out section data; + */ + seg = seghead; +- if (!debuginfo && !strcmp(seg->name, "??LINE")) ++ if (!debuginfo && seg && !strcmp(seg->name, "??LINE")) + seg = seg->next; + while (seg) { + if (seg->currentpos) { +-- +2.27.0 + diff --git a/nasm.spec b/nasm.spec index 583cfb80c003cb6cbabf227a44fa09a115f57bcf..15fa01114490e87c189dba6e23002ccf6a8f19ba 100644 --- a/nasm.spec +++ b/nasm.spec @@ -8,7 +8,7 @@ Name: nasm Version: 2.15.05 -Release: 1 +Release: 2 Summary: The Netwide Assembler, a portable x86 assembler with Intel-like syntax License: BSD URL: http://www.nasm.us @@ -20,6 +20,7 @@ Patch6001: fix-help-info-error.patch # https://github.com/netwide-assembler/nasm/commit/2d4e6952417ec6f08b6f135d2b5d0e19b7dae30d Patch6002: CVE-2022-44370.patch Patch6003: CVE-2020-21528.patch +Patch6004: CVE-2023-38665.patch #https://bugzilla.nasm.us/attachment.cgi?id=411648 BuildRequires: perl(Env) autoconf asciidoc xmlto gcc make git @@ -93,6 +94,9 @@ make test %{_mandir}/man1/ld* %changelog +* Sat Oct 26 2024 liningjie - 2.15.05-2 +- Fix CVE-2023-38665 + * Wed Jun 26 2024 yaoxin - 2.15.05-1 - Update to 2.15.05 * fix %ifid with $ and $$