summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorDeepesh Varatharajan <Deepesh.Varatharajan@windriver.com>2025-05-20 21:54:14 -0700
committerSteve Sakoman <steve@sakoman.com>2025-06-02 10:26:30 -0700
commit9776909c9bbeb27b843eeb6c8a974285500eaebb (patch)
treee84e944eb8857ea12485c386c5ac24a94ed4b463 /meta
parent717fb8a016297ccf9bc2abcc20fa36e07ebbe9e2 (diff)
downloadpoky-9776909c9bbeb27b843eeb6c8a974285500eaebb.tar.gz
binutils: Fix CVE-2025-1178
Prevent an abort in the bfd linker when attempting to generate dynamic relocs for a corrupt input file. PR 32638 Backport a patch from upstream to fix CVE-2025-1178 Upstream-Status: Backport from [https://sourceware.org/git/?p=binutils-gdb.git;a=patch;h=75086e9de1707281172cc77f178e7949a4414ed0] (From OE-Core rev: 3325b9dfd7a0da2236c96630b67ac2c6d4375840) Signed-off-by: Deepesh Varatharajan <Deepesh.Varatharajan@windriver.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-devtools/binutils/binutils-2.44.inc1
-rw-r--r--meta/recipes-devtools/binutils/binutils/0015-CVE-2025-1178.patch33
2 files changed, 34 insertions, 0 deletions
diff --git a/meta/recipes-devtools/binutils/binutils-2.44.inc b/meta/recipes-devtools/binutils/binutils-2.44.inc
index 28100abbe9..681b42fc3c 100644
--- a/meta/recipes-devtools/binutils/binutils-2.44.inc
+++ b/meta/recipes-devtools/binutils/binutils-2.44.inc
@@ -35,5 +35,6 @@ SRC_URI = "\
35 file://0012-Only-generate-an-RPATH-entry-if-LD_RUN_PATH-is-not-e.patch \ 35 file://0012-Only-generate-an-RPATH-entry-if-LD_RUN_PATH-is-not-e.patch \
36 file://0013-Define-alignof-using-_Alignof-when-using-C11-or-newe.patch \ 36 file://0013-Define-alignof-using-_Alignof-when-using-C11-or-newe.patch \
37 file://0014-Remove-duplicate-pe-dll.o-entry-deom-targ_extra_ofil.patch \ 37 file://0014-Remove-duplicate-pe-dll.o-entry-deom-targ_extra_ofil.patch \
38 file://0015-CVE-2025-1178.patch \
38" 39"
39S = "${WORKDIR}/git" 40S = "${WORKDIR}/git"
diff --git a/meta/recipes-devtools/binutils/binutils/0015-CVE-2025-1178.patch b/meta/recipes-devtools/binutils/binutils/0015-CVE-2025-1178.patch
new file mode 100644
index 0000000000..c39f43fba4
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/0015-CVE-2025-1178.patch
@@ -0,0 +1,33 @@
1From 75086e9de1707281172cc77f178e7949a4414ed0 Mon Sep 17 00:00:00 2001
2From: Nick Clifton <nickc@redhat.com>
3Date: Wed, 5 Feb 2025 13:26:51 +0000
4Subject: [PATCH] Prevent an abort in the bfd linker when attempting to
5 generate dynamic relocs for a corrupt input file.
6
7PR 32638
8
9Upstream-Status: Backport [https://sourceware.org/git/?p=binutils-gdb.git;a=patch;h=75086e9de1707281172cc77f178e7949a4414ed0]
10CVE: CVE-2025-1178
11
12Signed-off-by: Deepesh Varatharajan <Deepesh.Varatharajan@windriver.com>
13
14diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
15index cb32732e..a08e9c97 100644
16--- a/bfd/elf64-x86-64.c
17+++ b/bfd/elf64-x86-64.c
18@@ -5031,6 +5031,15 @@ elf_x86_64_finish_dynamic_symbol (bfd *output_bfd,
19
20 if (generate_dynamic_reloc)
21 {
22+ /* If the relgot section has not been created, then
23+ generate an error instead of a reloc. cf PR 32638. */
24+ if (relgot == NULL || relgot->size == 0)
25+ {
26+ info->callbacks->einfo (_("%F%pB: Unable to generate dynamic relocs because a suitable section does not exist\n"),
27+ output_bfd);
28+ return false;
29+ }
30+
31 if (relative_reloc_name != NULL
32 && htab->params->report_relative_reloc)
33 _bfd_x86_elf_link_report_relative_reloc