|
| 1 | +From 615a0496206ed16a93f3362d6189bdf8ba7c3523 Mon Sep 17 00:00:00 2001 |
| 2 | +From: Azure Linux Security Servicing Account |
| 3 | + <azurelinux-security@microsoft.com> |
| 4 | +Date: Mon, 28 Jul 2025 19:39:05 +0000 |
| 5 | +Subject: [PATCH] Fix CVE CVE-2025-8225 in binutils |
| 6 | + |
| 7 | +[AI Backported] Upstream Patch Reference: https://gitlab.com/gnutools/binutils-gdb/-/commit/e51fdff7d2e538c0e5accdd65649ac68e6e0ddd4 |
| 8 | +(Revised by <v-klockwood@microsoft.com>) |
| 9 | +--- |
| 10 | + binutils/dwarf.c | 10 ++++------ |
| 11 | + 1 file changed, 4 insertions(+), 6 deletions(-) |
| 12 | + |
| 13 | +diff --git a/binutils/dwarf.c b/binutils/dwarf.c |
| 14 | +index d976a64b..7934b2b5 100644 |
| 15 | +--- a/binutils/dwarf.c |
| 16 | ++++ b/binutils/dwarf.c |
| 17 | +@@ -3480,14 +3480,12 @@ process_debug_info (struct dwarf_section * section, |
| 18 | + return false; |
| 19 | + } |
| 20 | + |
| 21 | +- if ((do_loc || do_debug_loc || do_debug_ranges) |
| 22 | +- && num_debug_info_entries == 0 |
| 23 | +- && ! do_types) |
| 24 | ++ if ((do_loc || do_debug_loc || do_debug_ranges || do_debug_info) |
| 25 | ++ && alloc_num_debug_info_entries == 0 |
| 26 | ++ && !do_types) |
| 27 | + { |
| 28 | +- |
| 29 | + /* Then allocate an array to hold the information. */ |
| 30 | +- debug_information = (debug_info *) cmalloc (num_units, |
| 31 | +- sizeof (* debug_information)); |
| 32 | ++ debug_information = cmalloc (num_units, sizeof (*debug_information)); |
| 33 | + if (debug_information == NULL) |
| 34 | + { |
| 35 | + error (_("Not enough memory for a debug info array of %u entries\n"), |
| 36 | +-- |
| 37 | +2.45.4 |
| 38 | + |
0 commit comments