diff options
| -rw-r--r-- | meta/recipes-devtools/binutils/binutils-2.44.inc | 1 | ||||
| -rw-r--r-- | meta/recipes-devtools/binutils/binutils/0019-CVE-2025-7545.patch | 39 |
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 | " |
| 47 | S = "${WORKDIR}/git" | 48 | S = "${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 @@ | |||
| 1 | From: "H.J. Lu" <hjl.tools@gmail.com> | ||
| 2 | Date: Sat, 21 Jun 2025 06:36:56 +0800 | ||
| 3 | |||
| 4 | Upstream-Status: Backport [https://sourceware.org/git/?p=binutils-gdb.git;a=patch;h08c3cbe5926e4d355b5cb70bbec2b1eeb40c2944] | ||
| 5 | CVE: CVE-2025-7545 | ||
| 6 | |||
| 7 | Since the output section contents are copied from the input, don't | ||
| 8 | extend 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 | |||
| 14 | Signed-off-by: Deepesh Varatharajan <Deepesh.Varatharajan@windriver.com> | ||
| 15 | |||
| 16 | diff --git a/binutils/objcopy.c b/binutils/objcopy.c | ||
| 17 | index 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++; | ||
