summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools
diff options
context:
space:
mode:
authorDeepesh Varatharajan <Deepesh.Varatharajan@windriver.com>2025-07-16 02:41:53 -0700
committerSteve Sakoman <steve@sakoman.com>2025-07-21 09:18:00 -0700
commitb5cd1f745773311cd85f133ca37de58d854815ca (patch)
tree5801e3a461d45b4e789f77ef994f9baa099a8c16 /meta/recipes-devtools
parent648f6d1fdddcdbd082d3439f1ab5e932dafdd357 (diff)
downloadpoky-b5cd1f745773311cd85f133ca37de58d854815ca.tar.gz
binutils: Fix CVE-2025-7545
objcopy: Don't extend the output section size Since the output section contents are copied from the input, don't extend the output section size beyond the input section size. Backport a patch from upstream to fix CVE-2025-7545 Upstream-Status: Backport [https://sourceware.org/git/?p=binutils-gdb.git;a=patch;h=08c3cbe5926e4d355b5cb70bbec2b1eeb40c2944] (From OE-Core rev: 9730ddc98bd961d4e2b5b79fa60a2dde1d2a3301) Signed-off-by: Deepesh Varatharajan <Deepesh.Varatharajan@windriver.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'meta/recipes-devtools')
-rw-r--r--meta/recipes-devtools/binutils/binutils-2.44.inc1
-rw-r--r--meta/recipes-devtools/binutils/binutils/0019-CVE-2025-7545.patch39
2 files changed, 40 insertions, 0 deletions
diff --git a/meta/recipes-devtools/binutils/binutils-2.44.inc b/meta/recipes-devtools/binutils/binutils-2.44.inc
index 0f0befe30e..8a26fe76f1 100644
--- a/meta/recipes-devtools/binutils/binutils-2.44.inc
+++ b/meta/recipes-devtools/binutils/binutils-2.44.inc
@@ -43,5 +43,6 @@ SRC_URI = "\
43 file://0016-CVE-2025-5244.patch \ 43 file://0016-CVE-2025-5244.patch \
44 file://0016-CVE-2025-3198.patch \ 44 file://0016-CVE-2025-3198.patch \
45 file://0018-CVE-2025-5245.patch \ 45 file://0018-CVE-2025-5245.patch \
46 file://0019-CVE-2025-7545.patch \
46" 47"
47S = "${WORKDIR}/git" 48S = "${WORKDIR}/git"
diff --git a/meta/recipes-devtools/binutils/binutils/0019-CVE-2025-7545.patch b/meta/recipes-devtools/binutils/binutils/0019-CVE-2025-7545.patch
new file mode 100644
index 0000000000..062d6721b6
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/0019-CVE-2025-7545.patch
@@ -0,0 +1,39 @@
1From: "H.J. Lu" <hjl.tools@gmail.com>
2Date: Sat, 21 Jun 2025 06:36:56 +0800
3
4Upstream-Status: Backport [https://sourceware.org/git/?p=binutils-gdb.git;a=patch;h08c3cbe5926e4d355b5cb70bbec2b1eeb40c2944]
5CVE: CVE-2025-7545
6
7Since the output section contents are copied from the input, don't
8extend the output section size beyond the input section size.
9
10 PR binutils/33049
11 * objcopy.c (copy_section): Don't extend the output section
12 size beyond the input section size.
13
14Signed-off-by: Deepesh Varatharajan <Deepesh.Varatharajan@windriver.com>
15
16diff --git a/binutils/objcopy.c b/binutils/objcopy.c
17index e2e6bd7e..3cbb3977 100644
18--- a/binutils/objcopy.c
19+++ b/binutils/objcopy.c
20@@ -4634,6 +4634,7 @@ copy_section (bfd *ibfd, sec_ptr isection, bfd *obfd)
21 char *to = (char *) memhunk;
22 char *end = (char *) memhunk + size;
23 int i;
24+ bfd_size_type memhunk_size = size;
25
26 /* If the section address is not exactly divisible by the interleave,
27 then we must bias the from address. If the copy_byte is less than
28@@ -4653,6 +4654,11 @@ copy_section (bfd *ibfd, sec_ptr isection, bfd *obfd)
29 }
30
31 size = (size + interleave - 1 - copy_byte) / interleave * copy_width;
32+
33+ /* Don't extend the output section size. */
34+ if (size > memhunk_size)
35+ size = memhunk_size;
36+
37 osection->lma /= interleave;
38 if (copy_byte < extra)
39 osection->lma++;