[Bug libdw/31874] Tests failure on aarch64 with pointer authentication on

2024-06-14 Thread ema at debian dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=31874 --- Comment #7 from Emanuele Rocca --- I just double-checked that the patchset sent by Steve Capper to the list fixes all tests on my systems with pointer authentication on: https://sourceware.org/pipermail/elfutils-devel/2024q2/007127.html -

[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

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

2024-06-14 Thread Steve Capper
From: German Gomez Implement DW_CFA_AARCH64_negate_ra_state in accordance with the DWARF AARCH64 ABI [1]. Followup commits will use the value of this register to remove the PAC from return addresses. [1] https://github.com/ARM-software/abi-aa/blob/main/aadwarf64/aadwarf64.rst#44call-frame-inst

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

2024-06-14 Thread Steve Capper
From: German Gomez This register will be used to indicate whether a return address is mangled with a PAC or not, in accordance with the DWARF AARCH64 ABI [1]. [1] https://github.com/ARM-software/abi-aa/blob/main/aadwarf64/aadwarf64.rst#41dwarf-register-names Signed-off-by: German Gomez Signed

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

2024-06-14 Thread Steve Capper
From: German Gomez Add user API for setting the PAC mask. The function is intended to be called in Dwfl_Thread_Callbacks.set_initial_registers. Testing notes: ... consider the following program.c | int a = 0; | void leaf(void) { | for (;;) | a += a; | } | void parent(void) { |

[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 0/5] Enable PAC support in elfutils

2024-06-14 Thread Steve Capper
Hello, This series enables Pointer Authentication (PAC) support in elfutils. The first four patches were originally posted by German Gomez. I've rebased to the latest elfutils and added an extra patch that was required to debug core dumps from PAC enabled applications. These patches were tested o