diff options
| author | Deepesh Varatharajan <Deepesh.Varatharajan@windriver.com> | 2025-06-08 21:48:49 -0700 |
|---|---|---|
| committer | Steve Sakoman <steve@sakoman.com> | 2025-06-13 08:42:35 -0700 |
| commit | c6848d874c2f49e9b9aead0dbac475dedd8a1492 (patch) | |
| tree | 4c18bd9dad142aba0f9f6a9d38ee1b0401b665bb /meta/recipes-devtools | |
| parent | 87267b3370b28e9ad352a88d8f01a67965f60715 (diff) | |
| download | poky-c6848d874c2f49e9b9aead0dbac475dedd8a1492.tar.gz | |
binutils: Fix CVE-2025-5244 & CVE-2025-5245
PR32858 ld segfault on fuzzed object
We missed one place where it is necessary to check for empty groups.
PR32829, SEGV on objdump function debug_type_samep
u.kenum is always non-NULL, see debug_make_enum_type.
Upstream-Status: Backport
[https://sourceware.org/git/?p=binutils-gdb.git;a=patch;h=d1458933830456e54223d9fc61f0d9b3a19256f5]
&& [https://sourceware.org/git/?p=binutils-gdb.git;a=patch;h=6c3458a8b7ee7d39f070c7b2350851cb2110c65a]
(From OE-Core rev: 7eb29f802b272dec19c5bfdce93155d99bac918d)
Signed-off-by: Deepesh Varatharajan <Deepesh.Varatharajan@windriver.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'meta/recipes-devtools')
3 files changed, 65 insertions, 0 deletions
diff --git a/meta/recipes-devtools/binutils/binutils-2.38.inc b/meta/recipes-devtools/binutils/binutils-2.38.inc index 085ca2301e..f1c29015bc 100644 --- a/meta/recipes-devtools/binutils/binutils-2.38.inc +++ b/meta/recipes-devtools/binutils/binutils-2.38.inc | |||
| @@ -76,5 +76,7 @@ SRC_URI = "\ | |||
| 76 | file://0039-CVE-2025-1178.patch \ | 76 | file://0039-CVE-2025-1178.patch \ |
| 77 | file://0040-CVE-2025-1180.patch \ | 77 | file://0040-CVE-2025-1180.patch \ |
| 78 | file://0040-CVE-2025-1182.patch \ | 78 | file://0040-CVE-2025-1182.patch \ |
| 79 | file://0041-CVE-2025-5244.patch \ | ||
| 80 | file://0042-CVE-2025-5245.patch \ | ||
| 79 | " | 81 | " |
| 80 | S = "${WORKDIR}/git" | 82 | S = "${WORKDIR}/git" |
diff --git a/meta/recipes-devtools/binutils/binutils/0041-CVE-2025-5244.patch b/meta/recipes-devtools/binutils/binutils/0041-CVE-2025-5244.patch new file mode 100644 index 0000000000..e8855a4b4b --- /dev/null +++ b/meta/recipes-devtools/binutils/binutils/0041-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) | ||
diff --git a/meta/recipes-devtools/binutils/binutils/0042-CVE-2025-5245.patch b/meta/recipes-devtools/binutils/binutils/0042-CVE-2025-5245.patch new file mode 100644 index 0000000000..2de6abbe93 --- /dev/null +++ b/meta/recipes-devtools/binutils/binutils/0042-CVE-2025-5245.patch | |||
| @@ -0,0 +1,38 @@ | |||
| 1 | From: Alan Modra <amodra@gmail.com> | ||
| 2 | Date: Tue, 1 Apr 2025 22:36:54 +1030 | ||
| 3 | |||
| 4 | PR32829, SEGV on objdump function debug_type_samep | ||
| 5 | u.kenum is always non-NULL, see debug_make_enum_type. | ||
| 6 | |||
| 7 | Upstream-Status: Backport [https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=6c3458a8b7ee7d39f070c7b2350851cb2110c65a] | ||
| 8 | CVE: CVE-2025-5245 | ||
| 9 | |||
| 10 | Signed-off-by: Deepesh Varatharajan <Deepesh.Varatharajan@windriver.com> | ||
| 11 | |||
| 12 | diff --git a/binutils/debug.c b/binutils/debug.c | ||
| 13 | index 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 | @@ -3098,9 +3095,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 | { | ||
