diff --git a/_gdb.spec.Patch.include b/_gdb.spec.Patch.include index 4404807..1647254 100644 --- a/_gdb.spec.Patch.include +++ b/_gdb.spec.Patch.include @@ -284,3 +284,7 @@ Patch067: gdb-gcc-13-backport-self-move-diagnostic-fix # (Simon Marchi, backtrace/29374) Patch068: gdb-backport-call-check_typedef-at-beginning-of-dwarf_expr_context.patch +# Backport "Fix an illegal memory access when parsing..." +# (Nick Clifton, RHBZ 2153228) +Patch069: gdb-rhbz2153228-fail-if-sh_info-is-zero.patch + diff --git a/_gdb.spec.patch.include b/_gdb.spec.patch.include index f004491..4ef8e6c 100644 --- a/_gdb.spec.patch.include +++ b/_gdb.spec.patch.include @@ -66,3 +66,4 @@ %patch066 -p1 %patch067 -p1 %patch068 -p1 +%patch069 -p1 diff --git a/_patch_order b/_patch_order index 20b172f..9258332 100644 --- a/_patch_order +++ b/_patch_order @@ -65,4 +65,5 @@ gdb-rhbz2143992-libiberty-fix-c89isms-in-configure.patch gdb-rhbz2152431-label-symbol-value.patch gdb-backport-python-config-replace-deprecated-distutils.patch gdb-gcc-13-backport-self-move-diagnostic-fix -gdb-backport-call-check_typedef-at-beginning-of-dwarf_expr_context.patch \ No newline at end of file +gdb-backport-call-check_typedef-at-beginning-of-dwarf_expr_context.patch +gdb-rhbz2153228-fail-if-sh_info-is-zero.patch diff --git a/gdb-rhbz2153228-fail-if-sh_info-is-zero.patch b/gdb-rhbz2153228-fail-if-sh_info-is-zero.patch new file mode 100644 index 0000000..07c8e14 --- /dev/null +++ b/gdb-rhbz2153228-fail-if-sh_info-is-zero.patch @@ -0,0 +1,26 @@ +From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 +From: Nick Clifton +Date: Wed, 19 Oct 2022 15:09:12 +0100 +Subject: gdb-rhbz2153228-fail-if-sh_info-is-zero.patch + +;; Backport "Fix an illegal memory access when parsing..." +;; (Nick Clifton, RHBZ 2153228) + + PR 29699 + * elf.c (_bfd_elf_slurp_version_tables): Fail if the sh_info field + of the section header is zero. + +diff --git a/bfd/elf.c b/bfd/elf.c +--- a/bfd/elf.c ++++ b/bfd/elf.c +@@ -8832,7 +8832,9 @@ _bfd_elf_slurp_version_tables (bfd *abfd, bool default_imported_symver) + bfd_set_error (bfd_error_file_too_big); + goto error_return_verref; + } +- elf_tdata (abfd)->verref = (Elf_Internal_Verneed *) bfd_alloc (abfd, amt); ++ if (amt == 0) ++ goto error_return_verref; ++ elf_tdata (abfd)->verref = (Elf_Internal_Verneed *) bfd_zalloc (abfd, amt); + if (elf_tdata (abfd)->verref == NULL) + goto error_return_verref; + diff --git a/gdb.spec b/gdb.spec index 9fe7277..2b0cde4 100644 --- a/gdb.spec +++ b/gdb.spec @@ -69,7 +69,7 @@ Version: 12.1 # The release always contains a leading reserved number, start it at 1. # `upstream' is not a part of `name' to stay fully rpm dependencies compatible for the testing. -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and LGPLv3+ and BSD and Public Domain and GFDL # Do not provide URL for snapshots as the file lasts there only for 2 days. @@ -1201,6 +1201,10 @@ fi %endif %changelog +* Thu Apr 27 2023 Keith Seitz - 12.1-2.el9 +- Backport binutls/29699 "Fix an illegal memory access when parsing..." + (Nick Clifton, RHBZ 2153228) + * Tue Apr 18 2023 Keith Seitz - 12.1-1.el9 - Initial import for GTS13.