mbox series

[v2,0/9] AArch64 Guarded Control Stack support

Message ID 20250618055445.709416-1-thiago.bauermann@linaro.org
Headers show
Series AArch64 Guarded Control Stack support | expand

Message

Thiago Jung Bauermann June 18, 2025, 5:54 a.m. UTC
Hello,

This version addresses review comments from Eli, Christina and Luis.  It's
mostly small code fixes and reorganization of documentation and testcases
into different patches.

The exception is patch 8, which is a new patch implementing unwind of the
GCSPR, fixing problems with the return command identified by Christina
Schimpe (thanks!).  The code and testcase in that patch are essentially the
same as the ones in her CET shadow stack patch series (thanks again!).

As suggested by Christina Schimpe, I moved the testcases to the patches
adding the code that they test.

I also moved the manual changes and NEWS entry to a separate patch.

Patch 2 from v1 (GDB: doc: Improve AArch64 and ARM subsubsection titles in
gdb.texinfo) was already committed.

The first 3 patches are from Christina's CET shadow stack v4 series and are
included in this series so that the CI can apply and test it.

v1 can be found here:

https://inbox.sourceware.org/gdb-patches/20250608010338.2234530-1-thiago.bauermann@linaro.org/

Christina Schimpe (3):
  GDB: Linux: Add function linux_address_in_shadow_stack_mem_range
  gdb, gdbarch: Enable inferior calls for shadow stack support.
  gdb, gdbarch: Introduce gdbarch method to get the shadow stack
    pointer.

Thiago Jung Bauermann (6):
  bfd/aarch64-linux: Support reading and writing the GCS core file note
  GDB, gdbserver: aarch64-linux: Initial Guarded Control Stack support
  GDB: aarch64-linux: GCS support in Linux signals
  GDB: aarch64-linux: Implement GCS support in displaced stepping
  GDB: aarch64-linux: Support unwinding the GCSPR
  GDB: doc: Document Linux AArch64 support for Guarded Control Stacks

 bfd/elf.c                                     |  31 +++
 gdb/NEWS                                      |   3 +
 gdb/aarch64-linux-nat.c                       |  79 ++++++++
 gdb/aarch64-linux-tdep.c                      | 191 +++++++++++++++++-
 gdb/aarch64-tdep.c                            | 156 +++++++++++++-
 gdb/aarch64-tdep.h                            |  25 +++
 gdb/arch-utils.c                              |  10 +
 gdb/arch-utils.h                              |   5 +
 gdb/arch/aarch64-gcs-linux.h                  |  44 ++++
 gdb/arch/aarch64.c                            |   8 +
 gdb/arch/aarch64.h                            |  10 +-
 gdb/doc/gdb.texinfo                           |  83 ++++++++
 gdb/features/Makefile                         |   2 +
 gdb/features/aarch64-gcs-linux.c              |  21 ++
 gdb/features/aarch64-gcs-linux.xml            |  18 ++
 gdb/features/aarch64-gcs.c                    |  14 ++
 gdb/features/aarch64-gcs.xml                  |  11 +
 gdb/gdbarch-gen.c                             |  54 +++++
 gdb/gdbarch-gen.h                             |  24 +++
 gdb/gdbarch_components.py                     |  31 +++
 gdb/infcall.c                                 |  14 +-
 gdb/linux-tdep.c                              |  47 +++++
 gdb/linux-tdep.h                              |  18 ++
 gdb/testsuite/gdb.arch/aarch64-gcs-core.c     | 124 ++++++++++++
 gdb/testsuite/gdb.arch/aarch64-gcs-core.exp   | 107 ++++++++++
 .../gdb.arch/aarch64-gcs-disp-step.c          | 140 +++++++++++++
 .../gdb.arch/aarch64-gcs-disp-step.exp        |  90 +++++++++
 gdb/testsuite/gdb.arch/aarch64-gcs-return.c   | 105 ++++++++++
 gdb/testsuite/gdb.arch/aarch64-gcs-return.exp | 132 ++++++++++++
 gdb/testsuite/gdb.arch/aarch64-gcs.c          | 168 +++++++++++++++
 gdb/testsuite/gdb.arch/aarch64-gcs.exp        |  78 +++++++
 gdb/testsuite/lib/gdb.exp                     |  68 ++++++-
 gdbserver/linux-aarch64-low.cc                |  46 +++++
 include/elf/common.h                          |   3 +
 34 files changed, 1939 insertions(+), 21 deletions(-)
 create mode 100644 gdb/arch/aarch64-gcs-linux.h
 create mode 100644 gdb/features/aarch64-gcs-linux.c
 create mode 100644 gdb/features/aarch64-gcs-linux.xml
 create mode 100644 gdb/features/aarch64-gcs.c
 create mode 100644 gdb/features/aarch64-gcs.xml
 create mode 100644 gdb/testsuite/gdb.arch/aarch64-gcs-core.c
 create mode 100644 gdb/testsuite/gdb.arch/aarch64-gcs-core.exp
 create mode 100644 gdb/testsuite/gdb.arch/aarch64-gcs-disp-step.c
 create mode 100644 gdb/testsuite/gdb.arch/aarch64-gcs-disp-step.exp
 create mode 100644 gdb/testsuite/gdb.arch/aarch64-gcs-return.c
 create mode 100644 gdb/testsuite/gdb.arch/aarch64-gcs-return.exp
 create mode 100644 gdb/testsuite/gdb.arch/aarch64-gcs.c
 create mode 100644 gdb/testsuite/gdb.arch/aarch64-gcs.exp