|
| 1 | +From 41461010eb7c79fee7a9d5f6209accdaac66cc6b Mon Sep 17 00:00:00 2001 |
| 2 | +From: "H.J. Lu" < [email protected]> |
| 3 | +Date: Sat, 21 Jun 2025 06:52:00 +0800 |
| 4 | +Subject: [PATCH] elf: Report corrupted group section |
| 5 | + |
| 6 | +Report corrupted group section instead of trying to recover. |
| 7 | + |
| 8 | + PR binutils/33050 |
| 9 | + * elf.c (bfd_elf_set_group_contents): Report corrupted group |
| 10 | + section. |
| 11 | + |
| 12 | +Signed-off-by: H.J. Lu < [email protected]> |
| 13 | + |
| 14 | +Modified patch to apply to AzureLinux |
| 15 | +Modified-by: Akhila Guruju < [email protected]> |
| 16 | +Date: Sun, 20 Jul 2025 06:32:49 +0000 |
| 17 | +Subject: [PATCH] Address CVE-2025-7546 |
| 18 | + |
| 19 | +Upstream Patch Reference: https://sourceware.org/git/?p=binutils-gdb.git;a=patch;h=41461010eb7c79fee7a9d5f6209accdaac66cc6b |
| 20 | +--- |
| 21 | + bfd/elf.c | 12 +++++++++++- |
| 22 | + 1 file changed, 11 insertions(+), 1 deletion(-) |
| 23 | + |
| 24 | +diff --git a/bfd/elf.c b/bfd/elf.c |
| 25 | +index 985167f..a3c6d48 100644 |
| 26 | +--- a/bfd/elf.c |
| 27 | ++++ b/bfd/elf.c |
| 28 | +@@ -3642,8 +3642,18 @@ bfd_elf_set_group_contents (bfd *abfd, asection *sec, void *failedptrarg) |
| 29 | + break; |
| 30 | + } |
| 31 | + |
| 32 | ++ /* We should always get here with loc == sec->contents + 4. Return |
| 33 | ++ an error for bogus SHT_GROUP sections. */ |
| 34 | + loc -= 4; |
| 35 | +- BFD_ASSERT (loc == sec->contents); |
| 36 | ++ if (loc != sec->contents) |
| 37 | ++ { |
| 38 | ++ /* xgettext:c-format */ |
| 39 | ++ _bfd_error_handler (_("%pB: corrupted group section: `%pA'"), |
| 40 | ++ abfd, sec); |
| 41 | ++ bfd_set_error (bfd_error_bad_value); |
| 42 | ++ *failedptr = true; |
| 43 | ++ return; |
| 44 | ++ } |
| 45 | + |
| 46 | + H_PUT_32 (abfd, sec->flags & SEC_LINK_ONCE ? GRP_COMDAT : 0, loc); |
| 47 | + } |
| 48 | +-- |
| 49 | +2.45.2 |
| 50 | + |
0 commit comments