diff options
| author | Yash Shinde <Yash.Shinde@windriver.com> | 2025-10-28 03:28:02 -0700 |
|---|---|---|
| committer | Steve Sakoman <steve@sakoman.com> | 2025-11-03 07:17:02 -0800 |
| commit | f2b841423f2fde0d87d40cd25386fd041681960e (patch) | |
| tree | 896d3bb3a6f4756c275c92fb03e104d423b7607f /meta/recipes-devtools/binutils | |
| parent | 3574b5a9d1716c4fe10fc9c40921fd6bead62f0a (diff) | |
| download | poky-f2b841423f2fde0d87d40cd25386fd041681960e.tar.gz | |
binutils: fix CVE-2025-8225
CVE: CVE-2025-8225
It is possible with fuzzed files to have num_debug_info_entries zero
after allocating space for debug_information, leading to multiple
allocations.
* dwarf.c (process_debug_info): Don't test num_debug_info_entries
to determine whether debug_information has been allocated,
test alloc_num_debug_info_entries.
Upstream-Status: Backport [https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=e51fdff7d2e538c0e5accdd65649ac68e6e0ddd4]
(From OE-Core rev: 7feed679262025b8405488d064e2c546a3ed7a0c)
Signed-off-by: Yash Shinde <Yash.Shinde@windriver.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'meta/recipes-devtools/binutils')
| -rw-r--r-- | meta/recipes-devtools/binutils/binutils-2.42.inc | 1 | ||||
| -rw-r--r-- | meta/recipes-devtools/binutils/binutils/0027-CVE-2025-8225.patch | 47 |
2 files changed, 48 insertions, 0 deletions
diff --git a/meta/recipes-devtools/binutils/binutils-2.42.inc b/meta/recipes-devtools/binutils/binutils-2.42.inc index 5447ab0da4..dcd3325ecc 100644 --- a/meta/recipes-devtools/binutils/binutils-2.42.inc +++ b/meta/recipes-devtools/binutils/binutils-2.42.inc | |||
| @@ -62,5 +62,6 @@ SRC_URI = "\ | |||
| 62 | file://0024-CVE-2025-11082.patch \ | 62 | file://0024-CVE-2025-11082.patch \ |
| 63 | file://0025-CVE-2025-11083.patch \ | 63 | file://0025-CVE-2025-11083.patch \ |
| 64 | file://0026-CVE-2025-11081.patch \ | 64 | file://0026-CVE-2025-11081.patch \ |
| 65 | file://0027-CVE-2025-8225.patch \ | ||
| 65 | " | 66 | " |
| 66 | S = "${WORKDIR}/git" | 67 | S = "${WORKDIR}/git" |
diff --git a/meta/recipes-devtools/binutils/binutils/0027-CVE-2025-8225.patch b/meta/recipes-devtools/binutils/binutils/0027-CVE-2025-8225.patch new file mode 100644 index 0000000000..410ba64143 --- /dev/null +++ b/meta/recipes-devtools/binutils/binutils/0027-CVE-2025-8225.patch | |||
| @@ -0,0 +1,47 @@ | |||
| 1 | From e51fdff7d2e538c0e5accdd65649ac68e6e0ddd4 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Alan Modra <amodra@gmail.com> | ||
| 3 | Date: Wed, 19 Feb 2025 22:45:29 +1030 | ||
| 4 | Subject: [PATCH] binutils/dwarf.c debug_information leak | ||
| 5 | |||
| 6 | It is possible with fuzzed files to have num_debug_info_entries zero | ||
| 7 | after allocating space for debug_information, leading to multiple | ||
| 8 | allocations. | ||
| 9 | |||
| 10 | * dwarf.c (process_debug_info): Don't test num_debug_info_entries | ||
| 11 | to determine whether debug_information has been allocated, | ||
| 12 | test alloc_num_debug_info_entries. | ||
| 13 | --- | ||
| 14 | |||
| 15 | Upstream-Status: Backport [https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=e51fdff7d2e538c0e5accdd65649ac68e6e0ddd4] | ||
| 16 | CVE: CVE-2025-8225 | ||
| 17 | |||
| 18 | binutils/dwarf.c | 8 +++----- | ||
| 19 | 1 file changed, 3 insertions(+), 5 deletions(-) | ||
| 20 | |||
| 21 | Signed-off-by: Alan Modra <amodra@gmail.com> | ||
| 22 | Signed-off-by: Yash Shinde <Yash.Shinde@windriver.com> | ||
| 23 | |||
| 24 | diff --git a/binutils/dwarf.c b/binutils/dwarf.c | ||
| 25 | index 8e004cea839..bfbf83ec9f4 100644 | ||
| 26 | --- a/binutils/dwarf.c | ||
| 27 | +++ b/binutils/dwarf.c | ||
| 28 | @@ -3807,13 +3807,11 @@ process_debug_info (struct dwarf_section * section, | ||
| 29 | } | ||
| 30 | |||
| 31 | if ((do_loc || do_debug_loc || do_debug_ranges || do_debug_info) | ||
| 32 | - && num_debug_info_entries == 0 | ||
| 33 | - && ! do_types) | ||
| 34 | + && alloc_num_debug_info_entries == 0 | ||
| 35 | + && !do_types) | ||
| 36 | { | ||
| 37 | - | ||
| 38 | /* Then allocate an array to hold the information. */ | ||
| 39 | - debug_information = (debug_info *) cmalloc (num_units, | ||
| 40 | - sizeof (* debug_information)); | ||
| 41 | + debug_information = cmalloc (num_units, sizeof (*debug_information)); | ||
| 42 | if (debug_information == NULL) | ||
| 43 | { | ||
| 44 | error (_("Not enough memory for a debug info array of %u entries\n"), | ||
| 45 | -- | ||
| 46 | 2.43.7 | ||
| 47 | |||
