Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH 0/6] Improved error handling for .gdb_index parsing
@ 2026-10-18 20:50 Andrew Burgess
  2026-10-18 20:50 ` [PATCH 1/6] gdb: a number of fixes " Andrew Burgess
                   ` (5 more replies)
  0 siblings, 6 replies; 13+ messages in thread
From: Andrew Burgess @ 2026-10-18 20:50 UTC (permalink / raw)
  To: gdb-patches; +Cc: Andrew Burgess

This started with Simon pointing out that one of my patches would
create an invalid .gdb_index, which when read back in would cause GDB
to crash.

After fixing my original patch, my second take away from Simon's
review was that GDB really shouldn't be crashing when presented with
an invalid .gdb_index.

Having looking through our .gdb_index code the error handling is
pretty minimal, we mostly assume that the incoming .gdb_index is
correctly formed, which we really shouldn't be doing -- it's extenal
input to GDB and we should treat it as untrusted.

I certainly don't claim that this series fixes all the bugs in our
.gdb_index parsing code, but it does fix a number of pretty obvious
ones, and adds a mechanism for generating .gdb_index sections to our
DWARF assembler, so future bug fixes should be easier to write tests
for.

Feedback welcome,

Thanks,
Andrew

---

Andrew Burgess (6):
  gdb: a number of fixes for .gdb_index parsing
  gdb: handle incorrect CU size in .gdb_index
  gdb: validate the CU vector offset when loading the .gdb_index
  gdb: address table parsing fixes and tests for .gdb_index
  gdb: handle corrupted .gdb_index header offsets
  gdb: extend .gdb_index tests to skip all data blocks

 gdb/dwarf2/read-gdb-index.c                   | 212 +++++-
 .../gdb.dwarf2/gdb-index-corrupted.c          |  47 ++
 .../gdb.dwarf2/gdb-index-corrupted.exp        | 679 +++++++++++++++++
 .../gdb.dwarf2/gdb-index-tiny-header.S        |  49 ++
 .../gdb.dwarf2/gdb-index-tiny-header.exp      | 121 +++
 gdb/testsuite/lib/dwarf.exp                   | 709 ++++++++++++++++++
 6 files changed, 1802 insertions(+), 15 deletions(-)
 create mode 100644 gdb/testsuite/gdb.dwarf2/gdb-index-corrupted.c
 create mode 100644 gdb/testsuite/gdb.dwarf2/gdb-index-corrupted.exp
 create mode 100644 gdb/testsuite/gdb.dwarf2/gdb-index-tiny-header.S
 create mode 100644 gdb/testsuite/gdb.dwarf2/gdb-index-tiny-header.exp


base-commit: abcacfa2875d31480637ac082ce4862d518992f2
-- 
2.25.4


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2026-10-20 19:32 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-18 20:50 [PATCH 0/6] Improved error handling for .gdb_index parsing Andrew Burgess
2026-10-18 20:50 ` [PATCH 1/6] gdb: a number of fixes " Andrew Burgess
2026-10-20 18:39   ` Simon Marchi
2026-10-18 20:50 ` [PATCH 2/6] gdb: handle incorrect CU size in .gdb_index Andrew Burgess
2026-10-20 18:50   ` Simon Marchi
2026-10-18 20:50 ` [PATCH 3/6] gdb: validate the CU vector offset when loading the .gdb_index Andrew Burgess
2026-10-20 19:00   ` Simon Marchi
2026-10-18 20:50 ` [PATCH 4/6] gdb: address table parsing fixes and tests for .gdb_index Andrew Burgess
2026-10-20 19:09   ` Simon Marchi
2026-10-18 20:50 ` [PATCH 5/6] gdb: handle corrupted .gdb_index header offsets Andrew Burgess
2026-10-20 19:23   ` Simon Marchi
2026-10-18 20:50 ` [PATCH 6/6] gdb: extend .gdb_index tests to skip all data blocks Andrew Burgess
2026-10-20 19:32   ` Simon Marchi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox