diff --git a/backport-CVE-2023-1972.patch b/backport-CVE-2023-1972.patch new file mode 100644 index 0000000000000000000000000000000000000000..275f5a11acf2f6d0e2498d033e0e07b4913a8fda --- /dev/null +++ b/backport-CVE-2023-1972.patch @@ -0,0 +1,35 @@ +From: Nick Clifton +Date: Thu, 30 Mar 2023 09:10:09 +0000 (+0100) +Subject: Fix an illegal memory access when an accessing a zer0-lengthverdef table. +X-Git-Tag: binutils-2_41~1100 +X-Git-Url: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff_plain;h=c22d38baefc5a7a1e1f5cdc9dbb556b1f0ec5c57 + +Fix an illegal memory access when an accessing a zer0-lengthverdef table. + + PR 30285 + * elf.c (_bfd_elf_slurp_version_tables): Fail if no version definitions are allocated. +--- + +diff --git a/bfd/elf.c b/bfd/elf.c +index 027d0143735..185028cbd97 100644 +--- a/bfd/elf.c ++++ b/bfd/elf.c +@@ -9030,6 +9030,9 @@ _bfd_elf_slurp_version_tables (bfd *abfd, bool default_imported_symver) + bfd_set_error (bfd_error_file_too_big); + goto error_return_verdef; + } ++ ++ if (amt == 0) ++ goto error_return_verdef; + elf_tdata (abfd)->verdef = (Elf_Internal_Verdef *) bfd_zalloc (abfd, amt); + if (elf_tdata (abfd)->verdef == NULL) + goto error_return_verdef; +@@ -9133,6 +9136,8 @@ _bfd_elf_slurp_version_tables (bfd *abfd, bool default_imported_symver) + bfd_set_error (bfd_error_file_too_big); + goto error_return; + } ++ if (amt == 0) ++ goto error_return; + elf_tdata (abfd)->verdef = (Elf_Internal_Verdef *) bfd_zalloc (abfd, amt); + if (elf_tdata (abfd)->verdef == NULL) + goto error_return; diff --git a/binutils.spec b/binutils.spec index e93f0e0a9508aba6d57947e875092b1a52d38c83..646d4bd551450a84e209466dffbf814d89055839 100644 --- a/binutils.spec +++ b/binutils.spec @@ -1,7 +1,7 @@ Summary: Binary utilities Name: binutils Version: 2.37 -Release: 19 +Release: 20 License: GPLv3+ URL: https://sourceware.org/binutils @@ -77,6 +77,7 @@ Patch51: CVE-2022-47008.patch Patch52: backport-CVE-2022-47011.patch Patch53: backport-CVE-2022-47696.patch Patch54: backport-CVE-2021-46174.patch +Patch55: backport-CVE-2023-1972.patch Provides: bundled(libiberty) @@ -400,6 +401,9 @@ fi %{_infodir}/bfd*info* %changelog +* Wed Aug 30 2023 eastb233 - 2.37-20 +- fix CVE-2023-1972 + * Tue Aug 29 2023 liningjie - 2.37-19 - fix CVE-2021-46174