Skip to content

Commit a308c83

Browse files
[Medium] Patch gdb for CVE-2025-7546 (microsoft#14371)
1 parent 9aca93b commit a308c83

File tree

2 files changed

+60
-1
lines changed

2 files changed

+60
-1
lines changed

SPECS/gdb/CVE-2025-7546.patch

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
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+

SPECS/gdb/gdb.spec

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Summary: C debugger
22
Name: gdb
33
Version: 11.2
4-
Release: 6%{?dist}
4+
Release: 7%{?dist}
55
License: GPLv2+
66
Vendor: Microsoft Corporation
77
Distribution: Mariner
@@ -17,6 +17,7 @@ Patch5: CVE-2022-48064.patch
1717
Patch6: CVE-2022-48065.patch
1818
Patch7: CVE-2022-47673.patch
1919
Patch8: CVE-2022-47696.patch
20+
Patch9: CVE-2025-7546.patch
2021
BuildRequires: expat-devel
2122
BuildRequires: gcc-c++
2223
BuildRequires: gcc-gfortran
@@ -80,6 +81,10 @@ rm -vf %{buildroot}%{_libdir}/libaarch64-unknown-linux-gnu-sim.a
8081
%check
8182
# disable security hardening for tests
8283
rm -f $(dirname $(gcc -print-libgcc-file-name))/../specs
84+
85+
# Remove libctf test suite, which causes compilation errors with the base tests
86+
rm -rvf libctf/testsuite
87+
8388
%make_build check TESTS="gdb.base/default.exp"
8489

8590
%files -f %{name}.lang
@@ -97,6 +102,10 @@ rm -f $(dirname $(gcc -print-libgcc-file-name))/../specs
97102
%{_mandir}/*/*
98103

99104
%changelog
105+
* Fri Jul 18 2025 Akhila Guruju <[email protected]> - 11.2-7
106+
- Patch CVE-2025-7546
107+
- Fix package tests
108+
100109
* Mon Apr 21 2025 Kanishk Bansal <[email protected]> - 11.2-6
101110
- Patch CVE-2022-47673, CVE-2022-47696 using an upstream patch
102111

0 commit comments

Comments
 (0)