From cf4172e018a9d1104f5927b68e4e20bca728bfd4 Mon Sep 17 00:00:00 2001 From: owl96 <13345526+owl96@user.noreply.gitee.com> Date: Wed, 23 Aug 2023 03:16:56 +0000 Subject: [PATCH] Fix CVE-2023-1579 Fix a potential illegal memory access in the BFD library when parsing a corrupt DWARF file. Signed-off-by: owl96 <13345526+owl96@user.noreply.gitee.com> --- binutils-CVE-2023-1579.patch | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 binutils-CVE-2023-1579.patch diff --git a/binutils-CVE-2023-1579.patch b/binutils-CVE-2023-1579.patch new file mode 100644 index 0000000..5b315bd --- /dev/null +++ b/binutils-CVE-2023-1579.patch @@ -0,0 +1,23 @@ +--- a/bfd/ChangeLog ++++ b/bfd/ChangeLog +@@ -1,3 +1,9 @@ ++2023-01-11 Nick Clifton ++ ++ PR 29988 ++ * dwarf2.c (read_indexed_address): Fix check for an out of range ++ offset. ++ + 2023-01-06 Nick Clifton + + +--- a/bfd/dwarf2.c ++++ b/bfd/dwarf2.c +@@ -1420,7 +1420,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; \ No newline at end of file -- Gitee