|
| 1 | +From 5ea79aec8f03363778904754b75337f73be0db16 Mon Sep 17 00:00:00 2001 |
| 2 | +From: Azure Linux Security Servicing Account |
| 3 | + <azurelinux-security@microsoft.com> |
| 4 | +Date: Thu, 17 Jul 2025 08:56:14 +0000 |
| 5 | +Subject: [PATCH] Fix CVE CVE-2025-7545 in binutils |
| 6 | + |
| 7 | +Upstream Patch Reference: https://github.com/bminor/binutils-gdb/commit/08c3cbe5926e4d355b5cb70bbec2b1eeb40c2944.patch |
| 8 | +--- |
| 9 | + binutils/objcopy.c | 6 ++++++ |
| 10 | + 1 file changed, 6 insertions(+) |
| 11 | + |
| 12 | +diff --git a/binutils/objcopy.c b/binutils/objcopy.c |
| 13 | +index a6c2e0dc..b9552398 100644 |
| 14 | +--- a/binutils/objcopy.c |
| 15 | ++++ b/binutils/objcopy.c |
| 16 | +@@ -4438,6 +4438,7 @@ copy_section (bfd *ibfd, sec_ptr isection, void *obfdarg) |
| 17 | + char *to = (char *) memhunk; |
| 18 | + char *end = (char *) memhunk + size; |
| 19 | + int i; |
| 20 | ++ bfd_size_type memhunk_size = size; |
| 21 | + |
| 22 | + /* If the section address is not exactly divisible by the interleave, |
| 23 | + then we must bias the from address. If the copy_byte is less than |
| 24 | +@@ -4457,6 +4458,11 @@ copy_section (bfd *ibfd, sec_ptr isection, void *obfdarg) |
| 25 | + } |
| 26 | + |
| 27 | + size = (size + interleave - 1 - copy_byte) / interleave * copy_width; |
| 28 | ++ |
| 29 | ++ /* Don't extend the output section size. */ |
| 30 | ++ if (size > memhunk_size) |
| 31 | ++ size = memhunk_size; |
| 32 | ++ |
| 33 | + osection->lma /= interleave; |
| 34 | + if (copy_byte < extra) |
| 35 | + osection->lma++; |
| 36 | +-- |
| 37 | +2.45.3 |
| 38 | + |
0 commit comments