Skip to content

Commit bf9803e

Browse files
Deepesh Varatharajanrpurdie
authored andcommitted
binutils: Fix CVE-2025-5244
PR32858 ld segfault on fuzzed object We missed one place where it is necessary to check for empty groups. Backport a patch from upstream to fix CVE-2025-5244 Upstream-Status: Backport [https://sourceware.org/git/?p=binutils-gdb.git;a=patch;h=d1458933830456e54223d9fc61f0d9b3a19256f5] Signed-off-by: Deepesh Varatharajan <Deepesh.Varatharajan@windriver.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
1 parent 610dc4e commit bf9803e

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

meta/recipes-devtools/binutils/binutils-2.44.inc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,6 @@ SRC_URI = "\
4141
file://0016-CVE-2025-1181-1.patch \
4242
file://0017-CVE-2025-1181-2.patch \
4343
file://0018-CVE-2025-5245.patch \
44+
file://0019-CVE-2025-5244.patch \
4445
"
4546
S = "${WORKDIR}/git"
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
From: Alan Modra <amodra@gmail.com>
2+
Date: Thu, 10 Apr 2025 19:41:49 +0930
3+
4+
Upstream-Status: Backport [https://sourceware.org/git/?p=binutils-gdb.git;a=patch;h=d1458933830456e54223d9fc61f0d9b3a19256f5]
5+
CVE: CVE-2025-5244
6+
7+
PR32858 ld segfault on fuzzed object
8+
We missed one place where it is necessary to check for empty groups.
9+
10+
Signed-off-by: Deepesh Varatharajan <Deepesh.Varatharajan@windriver.com>
11+
12+
diff --git a/bfd/elflink.c b/bfd/elflink.c
13+
index a76e8e38da7..549b7b7dd92 100644
14+
--- a/bfd/elflink.c
15+
+++ b/bfd/elflink.c
16+
@@ -14408,7 +14408,8 @@ elf_gc_sweep (bfd *abfd, struct bfd_link_info *info)
17+
if (o->flags & SEC_GROUP)
18+
{
19+
asection *first = elf_next_in_group (o);
20+
- o->gc_mark = first->gc_mark;
21+
+ if (first != NULL)
22+
+ o->gc_mark = first->gc_mark;
23+
}
24+
25+
if (o->gc_mark)

0 commit comments

Comments
 (0)