diff options
author | Deepesh Varatharajan <Deepesh.Varatharajan@windriver.com> | 2025-06-05 00:42:23 -0700 |
---|---|---|
committer | Steve Sakoman <steve@sakoman.com> | 2025-06-11 08:17:34 -0700 |
commit | 33fc46afb7e433f6f70b3c2312b52f6215952a49 (patch) | |
tree | 211ea6ddfb5bb607616889c33dea2e669c2727b3 | |
parent | da4536b97848944121acd3f3142c632606f1f7a2 (diff) | |
download | poky-33fc46afb7e433f6f70b3c2312b52f6215952a49.tar.gz |
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]
(From OE-Core rev: 31fc180f606c5bb141c9c6dd85a7b1d876e1d692)
Signed-off-by: Deepesh Varatharajan <Deepesh.Varatharajan@windriver.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
-rw-r--r-- | meta/recipes-devtools/binutils/binutils-2.42.inc | 1 | ||||
-rw-r--r-- | meta/recipes-devtools/binutils/binutils/0022-CVE-2025-5244.patch | 25 |
2 files changed, 26 insertions, 0 deletions
diff --git a/meta/recipes-devtools/binutils/binutils-2.42.inc b/meta/recipes-devtools/binutils/binutils-2.42.inc index c6fec579ae..ea018a48a3 100644 --- a/meta/recipes-devtools/binutils/binutils-2.42.inc +++ b/meta/recipes-devtools/binutils/binutils-2.42.inc | |||
@@ -52,5 +52,6 @@ SRC_URI = "\ | |||
52 | file://CVE-2025-1179-pre.patch \ | 52 | file://CVE-2025-1179-pre.patch \ |
53 | file://CVE-2025-1179.patch \ | 53 | file://CVE-2025-1179.patch \ |
54 | file://0022-CVE-2025-5245.patch \ | 54 | file://0022-CVE-2025-5245.patch \ |
55 | file://0022-CVE-2025-5244.patch \ | ||
55 | " | 56 | " |
56 | S = "${WORKDIR}/git" | 57 | S = "${WORKDIR}/git" |
diff --git a/meta/recipes-devtools/binutils/binutils/0022-CVE-2025-5244.patch b/meta/recipes-devtools/binutils/binutils/0022-CVE-2025-5244.patch new file mode 100644 index 0000000000..e8855a4b4b --- /dev/null +++ b/meta/recipes-devtools/binutils/binutils/0022-CVE-2025-5244.patch | |||
@@ -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) | ||