Backport "Fix a potential illegal memory access in the BFD library..."

(Nick Clifton, binutils/29988)
This commit is contained in:
Keith Seitz 2023-04-11 10:47:14 -07:00
parent 9b284f749c
commit fc4e284a6d
5 changed files with 34 additions and 0 deletions

View File

@ -257,3 +257,7 @@ Patch060: gdb-rhbz2177655-aarch64-pauth-valid-regcache.patch
# (Tom Tromey, RHBZ 2183595)
Patch061: gdb-rhbz2183595-rustc-inside_main.patch
# Backport "Fix a potential illegal memory access in the BFD library..."
# (Nick Clifton, binutils/29988)
Patch062: gdb-binutils29988-read_indexed_address.patch

View File

@ -59,3 +59,4 @@
%patch059 -p1
%patch060 -p1
%patch061 -p1
%patch062 -p1

View File

@ -59,3 +59,4 @@ gdb-libexec-add-index.patch
gdb-rhbz1553104-s390x-arch12-test.patch
gdb-rhbz2177655-aarch64-pauth-valid-regcache.patch
gdb-rhbz2183595-rustc-inside_main.patch
gdb-binutils29988-read_indexed_address.patch

View File

@ -0,0 +1,24 @@
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
From: Nick Clifton <nickc@redhat.com>
Date: Wed, 11 Jan 2023 12:13:46 +0000
Subject: gdb-binutils29988-read_indexed_address.patch
;; Backport "Fix a potential illegal memory access in the BFD library..."
;; (Nick Clifton, binutils/29988)
PR 29988
* dwarf2.c (read_indexed_address): Fix check for an out of range
offset.
diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c
--- a/bfd/dwarf2.c
+++ b/bfd/dwarf2.c
@@ -1412,7 +1412,7 @@ read_indexed_address (uint64_t idx, struct comp_unit *unit)
offset += unit->dwarf_addr_offset;
if (offset < unit->dwarf_addr_offset
|| offset > file->dwarf_addr_size
- || file->dwarf_addr_size - offset < unit->offset_size)
+ || file->dwarf_addr_size - offset < unit->addr_size)
return 0;
info_ptr = file->dwarf_addr_buffer + offset;

View File

@ -1192,6 +1192,10 @@ fi
%endif
%changelog
* Tue Apr 11 2023 Keith Seitz <keiths@redhat.com>
- Backport "Fix a potential illegal memory access in the BFD library..."
(Nick Clifton, binutils/29988)
* Fri Mar 31 2023 Keith Seitz <keiths@redhat.com> - 13.1-3
- Backport "Fix crash in inside_main_func".
(Tom Tromey, RHBZ 2183595)