]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gdb: amd64 linux coredump support with shadow stack.
authorChristina Schimpe <christina.schimpe@intel.com>
Thu, 11 Feb 2021 11:01:46 +0000 (12:01 +0100)
committerChristina Schimpe <christina.schimpe@intel.com>
Fri, 29 Aug 2025 17:02:09 +0000 (17:02 +0000)
commite07c03e47acb34a76f86fa212f09e9c7373dab57
tree6d54e90e0a059ec3aa00ed57a9acba434969e747
parent63b862be762e1e6e7ce667c6b4a1a3dd79939bf4
gdb: amd64 linux coredump support with shadow stack.

Intel's Control-Flow Enforcement Technology (CET) provides the shadow
stack feature for the x86 architecture.

This commit adds support to write and read the shadow-stack node in
corefiles.  This helps debugging return address violations post-mortem.
The format is synced with the linux kernel commit "x86: Add PTRACE
interface for shadow stack".  As the linux kernel restricts shadow
stack support to 64-bit, apply the fix for amd64 only.

Co-Authored-By: Christina Schimpe <christina.schimpe@intel.com>
Reviewed-By: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
Approved-By: Luis Machado <luis.machado@arm.com>
Approved-By: Andrew Burgess <aburgess@redhat.com>
---
The code and testcase are lightly adapted from:

[PATCH v3 5/9] GDB, gdbserver: aarch64-linux: Initial Guarded Control Stack support

https://sourceware.org/pipermail/gdb-patches/2025-June/218892.html
gdb/amd64-linux-tdep.c
gdb/testsuite/gdb.arch/amd64-shadow-stack-corefile.c [new file with mode: 0644]
gdb/testsuite/gdb.arch/amd64-shadow-stack-corefile.exp [new file with mode: 0644]