diff --git a/backport-PR29171-invalid-read-causing-SIGSEGV.patch b/backport-PR29171-invalid-read-causing-SIGSEGV.patch new file mode 100644 index 0000000000000000000000000000000000000000..afac8ddb19bf9c0e2c8934026ee576247467f776 --- /dev/null +++ b/backport-PR29171-invalid-read-causing-SIGSEGV.patch @@ -0,0 +1,54 @@ +From be38442ddacf1fd25c8868d0491ea9e98b0e9ca7 Mon Sep 17 00:00:00 2001 +From: Alan Modra +Date: Tue, 24 May 2022 10:47:35 +0930 +Subject: [PATCH] PR29171, invalid read causing SIGSEGV + +The fix here is to pass "section" down to read_and_display_attr_value. +The test in read_and_display_attr_value is a little bit of hardening. + + PR 29171 + * dwarf.c (display_debug_macro, display_debug_names): Pass section + to read_and_display_attr_value2. + (read_and_display_attr_value): Don't attempt to check for .dwo + section name when section is NULL. +--- + binutils/dwarf.c | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +diff --git a/binutils/dwarf.c b/binutils/dwarf.c +index d820c21527f..a0dfd4df481 100644 +--- a/binutils/dwarf.c ++++ b/binutils/dwarf.c +@@ -2717,7 +2717,7 @@ read_and_display_attr_value (unsigned long attribute, + case DW_FORM_strx4: + if (!do_loc) + { +- const char *suffix = strrchr (section->name, '.'); ++ const char *suffix = section ? strrchr (section->name, '.') : NULL; + bool dwo = suffix && strcmp (suffix, ".dwo") == 0; + + if (do_wide) +@@ -6273,8 +6273,9 @@ display_debug_macro (struct dwarf_section *section, + SAFE_BYTE_GET_AND_INC (val, desc, 1, end); + curr + = read_and_display_attr_value (0, val, 0, +- start, curr, end, 0, 0, offset_size, +- version, NULL, 0, NULL, ++ start, curr, end, 0, 0, ++ offset_size, version, ++ NULL, 0, section, + NULL, ' ', -1); + if (n != nargs - 1) + printf (","); +@@ -10310,7 +10311,7 @@ display_debug_names (struct dwarf_section *section, void *file) + unit_start, entryptr, unit_end, + 0, 0, offset_size, + dwarf_version, NULL, +- (tagno < 0), NULL, ++ (tagno < 0), section, + NULL, '=', -1); + } + ++tagno; +-- +2.43.0 + diff --git a/binutils.spec b/binutils.spec index 6dedf853af2291d4fd6b192ba077d8d36f9fcd1e..0b0800ecec2c0a8dc8fbed10555895f486a176a2 100644 --- a/binutils.spec +++ b/binutils.spec @@ -1,7 +1,7 @@ Summary: Binary utilities Name: binutils Version: 2.37 -Release: 36 +Release: 37 License: GPLv3+ URL: https://sourceware.org/binutils @@ -97,6 +97,7 @@ Patch3069: backport-CVE-2022-44840.patch Patch3070: backport-CVE-2025-5244.patch Patch3071: backport-CVE-2025-5245.patch Patch3072: backport-CVE-2025-7546.patch +Patch3073: backport-PR29171-invalid-read-causing-SIGSEGV.patch %ifarch loongarch64 # LoongArch @@ -480,6 +481,9 @@ fi %{_infodir}/bfd*info* %changelog +* Thu Sep 4 2025 yixiangzhike - 2.37-37 +- backport PR29171 to fix invalid read causing SIGSEGV + * Sat Aug 30 2025 eastb233 - 2.37-36 - Fix CVE-2022-44840, CVE-2025-5244, CVE-2025-5245, CVE-2025-7546