[PATCH 0/5] Enable PAC support in elfutils

2024-06-14 Thread Steve Capper
rch64: Create definitions for AARCH64_RA_SIGN_STATE register libdw, aarch64: Implement DW_CFA_AARCH64_negate_ra_state CFI instruction libdwfl, aarch64: Demangle return addresses using a PAC mask libdwfl, eu-stack, aarch64: Add API for setting AARCH64 PAC mask. Steve Capper (1): li

[PATCH 3/5] libdwfl, aarch64: Demangle return addresses using a PAC mask

2024-06-14 Thread Steve Capper
From: German Gomez Demangle mangled return addresses on AARCH64. The value of the masks is stored in the struct Dwfl_Thread. Signed-off-by: German Gomez Signed-off-by: Steve Capper --- libdwfl/dwfl_frame.c | 3 +++ libdwfl/frame_unwind.c | 14 +- libdwfl/libdwflP.h | 7

[PATCH 4/5] libdwfl, eu-stack, aarch64: Add API for setting AARCH64 PAC mask.

2024-06-14 Thread Steve Capper
267: | #0 0xaebd0804 leaf | #1 0xaebd0818 parent | #2 0xaebd0838 main | #3 0xbd52ad50 __libc_start_main | #4 0xaebd0694 $x Signed-off-by: German Gomez Signed-off-by: Steve Capper --- libdw/libdw.map| 1 + libdwfl/dwfl_frame_regs.c | 10 +

[PATCH 1/5] aarch64: Create definitions for AARCH64_RA_SIGN_STATE register

2024-06-14 Thread Steve Capper
Signed-off-by: Steve Capper --- backends/aarch64_init.c| 6 +++--- backends/aarch64_initreg.c | 2 ++ backends/aarch64_regs.c| 5 - libdw/dwarf.h | 5 + tests/run-addrcfi.sh | 1 + tests/run-allregs.sh | 1 + 6 files changed, 16 insertions(+), 4 deletions

[PATCH 2/5] libdw, aarch64: Implement DW_CFA_AARCH64_negate_ra_state CFI instruction

2024-06-14 Thread Steve Capper
-instructions Signed-off-by: German Gomez Signed-off-by: Steve Capper --- libdw/cfi.c | 14 +- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/libdw/cfi.c b/libdw/cfi.c index a7174405..743bfc07 100644 --- a/libdw/cfi.c +++ b/libdw/cfi.c @@ -125,6 +125,15 @@ execute_cfi

[PATCH 5/5] libdwfl, aarch64: Read PAC mask from core

2024-06-14 Thread Steve Capper
We need to read the PAC mask from a core file when debugging offline as the information is still needed to demangle return addresses. This commit pulls out the NT_ARM_PAC_MASK info from the core and feeds it through to dwfl_thread_state_aarch64_pauth for each thread. Signed-off-by: Steve Capper

Re: [PATCH 5/5] libdwfl, aarch64: Read PAC mask from core

2024-08-19 Thread Steve Capper
On 17/08/2024 01:13, Mark Wielaard wrote: Hi Steve, Hey Mark, On Fri, Jun 14, 2024 at 03:47:19PM +0100, Steve Capper wrote: We need to read the PAC mask from a core file when debugging offline as the information is still needed to demangle return addresses. This commit pulls out the

Re: [PATCH 0/5] Enable PAC support in elfutils

2024-08-22 Thread Steve Capper
On 21/08/2024 00:34, Mark Wielaard wrote: Hi Steve, Hey Mark, On Fri, Jun 14, 2024 at 03:47:14PM +0100, Steve Capper wrote: This series enables Pointer Authentication (PAC) support in elfutils. The first four patches were originally posted by German Gomez. I've rebased to the l

[PATCH v2 0/5] Enable PAC support in elfutils

2024-08-26 Thread Steve Capper
ez (3): aarch64: Create definitions for AARCH64_RA_SIGN_STATE register libdw, aarch64: Implement DW_CFA_AARCH64_negate_ra_state CFI instruction libdwfl, aarch64: Demangle return addresses using a PAC mask Steve Capper (2): libdwfl, aarch64: extend dwfl_thread_state_registers to handl

[PATCH v2 1/5] aarch64: Create definitions for AARCH64_RA_SIGN_STATE register

2024-08-26 Thread Steve Capper
[SteveC: move DW_AARCH64_RA_SIGN_STATE to cfi.h, fix comments] Signed-off-by: Steve Capper --- backends/aarch64_initreg.c | 2 ++ backends/aarch64_regs.c| 5 - libdw/cfi.h| 5 + tests/run-addrcfi.sh | 1 + tests/run-allregs.sh | 1 + 5 files changed, 13

[PATCH v2 2/5] libdw, aarch64: Implement DW_CFA_AARCH64_negate_ra_state CFI instruction

2024-08-26 Thread Steve Capper
-instructions Signed-off-by: German Gomez Signed-off-by: Steve Capper --- libdw/cfi.c | 14 +- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/libdw/cfi.c b/libdw/cfi.c index a7174405..743bfc07 100644 --- a/libdw/cfi.c +++ b/libdw/cfi.c @@ -125,6 +125,15 @@ execute_cfi

[PATCH v2 3/5] libdwfl, aarch64: Demangle return addresses using a PAC mask

2024-08-26 Thread Steve Capper
From: German Gomez Demangle mangled return addresses on AARCH64. The value of the masks is stored in the struct Dwfl_Thread. Signed-off-by: German Gomez [SteveC: remove dwfl_thread_state_aarch64_pauth] Signed-off-by: Steve Capper --- libdwfl/dwfl_frame.c | 3 +++ libdwfl/frame_unwind.c

[PATCH v2 5/5] libdwfl, aarch64: Read PAC mask from core

2024-08-26 Thread Steve Capper
We need to read the PAC mask from a core file when debugging offline as the information is still needed to demangle return addresses. This commit pulls out the NT_ARM_PAC_MASK info from the core and feeds it through to dwfl_thread_state_registers for each thread. Signed-off-by: Steve Capper

[PATCH v2 4/5] libdwfl, aarch64: extend dwfl_thread_state_registers to handle PAC

2024-08-26 Thread Steve Capper
handling the program counter). The AArch64 linux process attach logic is also extended to query ptrace for the PAC mask. A subsequent patch will add support for retrieving the PAC mask from an AArch64 linux core file. Signed-off-by: Steve Capper --- backends/aarch64_initreg.c | 10