summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools
diff options
context:
space:
mode:
authorPeter Marko <peter.marko@siemens.com>2025-10-13 21:07:46 +0200
committerSteve Sakoman <steve@sakoman.com>2025-10-17 07:27:24 -0700
commitf245c680a88701659cb32ca2eac78f31c5301594 (patch)
tree44732582c6d8016499f1bf759047439ceb453019 /meta/recipes-devtools
parent2325a1dbc53f7a3efe66cfacd01b3d18e45045ac (diff)
downloadpoky-f245c680a88701659cb32ca2eac78f31c5301594.tar.gz
binutils: patch CVE-2025-11083
Pick patch per link in NVD report. (From OE-Core rev: 99879f41af7272e597c9a8c4c0260d1b690f9051) Signed-off-by: Peter Marko <peter.marko@siemens.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'meta/recipes-devtools')
-rw-r--r--meta/recipes-devtools/binutils/binutils-2.38.inc1
-rw-r--r--meta/recipes-devtools/binutils/binutils/0045-CVE-2025-11083.patch77
2 files changed, 78 insertions, 0 deletions
diff --git a/meta/recipes-devtools/binutils/binutils-2.38.inc b/meta/recipes-devtools/binutils/binutils-2.38.inc
index 0fd950e694..2e978edc6f 100644
--- a/meta/recipes-devtools/binutils/binutils-2.38.inc
+++ b/meta/recipes-devtools/binutils/binutils-2.38.inc
@@ -81,5 +81,6 @@ SRC_URI = "\
81 file://0043-CVE-2025-7546.patch \ 81 file://0043-CVE-2025-7546.patch \
82 file://0043-CVE-2025-7545.patch \ 82 file://0043-CVE-2025-7545.patch \
83 file://0044-CVE-2025-11082.patch \ 83 file://0044-CVE-2025-11082.patch \
84 file://0045-CVE-2025-11083.patch \
84" 85"
85S = "${WORKDIR}/git" 86S = "${WORKDIR}/git"
diff --git a/meta/recipes-devtools/binutils/binutils/0045-CVE-2025-11083.patch b/meta/recipes-devtools/binutils/binutils/0045-CVE-2025-11083.patch
new file mode 100644
index 0000000000..d303f651b8
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/0045-CVE-2025-11083.patch
@@ -0,0 +1,77 @@
1From 9ca499644a21ceb3f946d1c179c38a83be084490 Mon Sep 17 00:00:00 2001
2From: "H.J. Lu" <hjl.tools@gmail.com>
3Date: Thu, 18 Sep 2025 16:59:25 -0700
4Subject: [PATCH] elf: Don't match corrupt section header in linker input
5
6Don't swap in nor match corrupt section header in linker input to avoid
7linker crash later.
8
9 PR ld/33457
10 * elfcode.h (elf_swap_shdr_in): Changed to return bool. Return
11 false for corrupt section header in linker input.
12 (elf_object_p): Reject if elf_swap_shdr_in returns false.
13
14Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
15
16CVE: CVE-2025-11083
17Upstream-Status: Backport [https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=9ca499644a21ceb3f946d1c179c38a83be084490]
18Signed-off-by: Peter Marko <peter.marko@siemens.com>
19---
20 bfd/elfcode.h | 14 +++++++++-----
21 1 file changed, 9 insertions(+), 5 deletions(-)
22
23diff --git a/bfd/elfcode.h b/bfd/elfcode.h
24index 9c65852e103..5224a1abee6 100644
25--- a/bfd/elfcode.h
26+++ b/bfd/elfcode.h
27@@ -298,7 +298,7 @@ elf_swap_ehdr_out (bfd *abfd,
28 /* Translate an ELF section header table entry in external format into an
29 ELF section header table entry in internal format. */
30
31-static void
32+static bool
33 elf_swap_shdr_in (bfd *abfd,
34 const Elf_External_Shdr *src,
35 Elf_Internal_Shdr *dst)
36@@ -328,6 +328,9 @@ elf_swap_shdr_in (bfd *abfd,
37 if (!abfd->read_only)
38 _bfd_error_handler (_("warning: %pB has a section "
39 "extending past end of file"), abfd);
40+ /* PR ld/33457: Don't match corrupt section header. */
41+ if (abfd->is_linker_input)
42+ return false;
43 abfd->read_only = 1;
44 }
45 }
46@@ -337,6 +340,7 @@ elf_swap_shdr_in (bfd *abfd,
47 dst->sh_entsize = H_GET_WORD (abfd, src->sh_entsize);
48 dst->bfd_section = NULL;
49 dst->contents = NULL;
50+ return true;
51 }
52
53 /* Translate an ELF section header table entry in internal format into an
54@@ -629,9 +633,9 @@ elf_object_p (bfd *abfd)
55
56 /* Read the first section header at index 0, and convert to internal
57 form. */
58- if (bfd_bread (&x_shdr, sizeof x_shdr, abfd) != sizeof (x_shdr))
59+ if (bfd_bread (&x_shdr, sizeof x_shdr, abfd) != sizeof (x_shdr)
60+ || !elf_swap_shdr_in (abfd, &x_shdr, &i_shdr))
61 goto got_no_match;
62- elf_swap_shdr_in (abfd, &x_shdr, &i_shdr);
63
64 /* If the section count is zero, the actual count is in the first
65 section header. */
66@@ -717,9 +721,9 @@ elf_object_p (bfd *abfd)
67 to internal form. */
68 for (shindex = 1; shindex < i_ehdrp->e_shnum; shindex++)
69 {
70- if (bfd_bread (&x_shdr, sizeof x_shdr, abfd) != sizeof (x_shdr))
71+ if (bfd_bread (&x_shdr, sizeof x_shdr, abfd) != sizeof (x_shdr)
72+ || !elf_swap_shdr_in (abfd, &x_shdr, i_shdrp + shindex))
73 goto got_no_match;
74- elf_swap_shdr_in (abfd, &x_shdr, i_shdrp + shindex);
75
76 /* Sanity check sh_link and sh_info. */
77 if (i_shdrp[shindex].sh_link >= num_sec)