summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDeepesh Varatharajan <Deepesh.Varatharajan@windriver.com>2025-06-04 22:30:52 -0700
committerSteve Sakoman <steve@sakoman.com>2025-06-11 08:17:34 -0700
commitda4536b97848944121acd3f3142c632606f1f7a2 (patch)
tree17b4be99fe4bf26ddf8e7d9894cdeaa87bbfa102
parent6ba8b8a487f61d511904dd7263a58a794d3d3bb5 (diff)
downloadpoky-da4536b97848944121acd3f3142c632606f1f7a2.tar.gz
binutils: Fix CVE-2025-5245
PR32829, SEGV on objdump function debug_type_samep u.kenum is always non-NULL, see debug_make_enum_type. Backport a patch from upstream to fix CVE-2025-5245 Upstream-Status: Backport [https://sourceware.org/git/?p=binutils-gdb.git;a=patch;h=6c3458a8b7ee7d39f070c7b2350851cb2110c65a] (From OE-Core rev: 8202e66670327b02ec3de18b5af4a8b09abdc50d) 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.inc1
-rw-r--r--meta/recipes-devtools/binutils/binutils/0022-CVE-2025-5245.patch38
2 files changed, 39 insertions, 0 deletions
diff --git a/meta/recipes-devtools/binutils/binutils-2.42.inc b/meta/recipes-devtools/binutils/binutils-2.42.inc
index 16db8bc05e..c6fec579ae 100644
--- a/meta/recipes-devtools/binutils/binutils-2.42.inc
+++ b/meta/recipes-devtools/binutils/binutils-2.42.inc
@@ -51,5 +51,6 @@ SRC_URI = "\
51 file://0021-CVE-2025-1153-3.patch \ 51 file://0021-CVE-2025-1153-3.patch \
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" 55"
55S = "${WORKDIR}/git" 56S = "${WORKDIR}/git"
diff --git a/meta/recipes-devtools/binutils/binutils/0022-CVE-2025-5245.patch b/meta/recipes-devtools/binutils/binutils/0022-CVE-2025-5245.patch
new file mode 100644
index 0000000000..d4b7d55966
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/0022-CVE-2025-5245.patch
@@ -0,0 +1,38 @@
1From: Alan Modra <amodra@gmail.com>
2Date: Tue, 1 Apr 2025 22:36:54 +1030
3
4PR32829, SEGV on objdump function debug_type_samep
5u.kenum is always non-NULL, see debug_make_enum_type.
6
7Upstream-Status: Backport [https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=6c3458a8b7ee7d39f070c7b2350851cb2110c65a]
8CVE: CVE-2025-5245
9
10Signed-off-by: Deepesh Varatharajan <Deepesh.Varatharajan@windriver.com>
11
12diff --git a/binutils/debug.c b/binutils/debug.c
13index dcc8ccde..465b18e7 100644
14--- a/binutils/debug.c
15+++ b/binutils/debug.c
16@@ -2554,9 +2554,6 @@ debug_write_type (struct debug_handle *info,
17 case DEBUG_KIND_UNION_CLASS:
18 return debug_write_class_type (info, fns, fhandle, type, tag);
19 case DEBUG_KIND_ENUM:
20- if (type->u.kenum == NULL)
21- return (*fns->enum_type) (fhandle, tag, (const char **) NULL,
22- (bfd_signed_vma *) NULL);
23 return (*fns->enum_type) (fhandle, tag, type->u.kenum->names,
24 type->u.kenum->values);
25 case DEBUG_KIND_POINTER:
26@@ -3097,9 +3094,9 @@ debug_type_samep (struct debug_handle *info, struct debug_type_s *t1,
27 break;
28
29 case DEBUG_KIND_ENUM:
30- if (t1->u.kenum == NULL)
31- ret = t2->u.kenum == NULL;
32- else if (t2->u.kenum == NULL)
33+ if (t1->u.kenum->names == NULL)
34+ ret = t2->u.kenum->names == NULL;
35+ else if (t2->u.kenum->names == NULL)
36 ret = false;
37 else
38 {