Re: [PATCH 0/4] Add AARCH64 pointer authentication support

2022-05-19 Thread German Gomez via Elfutils-devel
On 19/05/2022 14:30, German Gomez via Elfutils-devel wrote: > Hi Mark, thanks for looking, and sorry for the delay > > On 28/04/2022 20:56, Mark Wielaard wrote: >> Hi German, >> >> On Mon, Apr 25, 2022 at 02:03:07PM +, German Gomez via Elfutils-devel >> wro

Re: [PATCH 0/4] Add AARCH64 pointer authentication support

2022-05-19 Thread German Gomez via Elfutils-devel
Hi Mark, thanks for looking, and sorry for the delay On 28/04/2022 20:56, Mark Wielaard wrote: > Hi German, > > On Mon, Apr 25, 2022 at 02:03:07PM +0000, German Gomez via Elfutils-devel > wrote: >> I've included a set of patches in order to demangle return addresses in &g

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

2022-04-25 Thread German Gomez via Elfutils-devel
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) { | leaf(); | } | int

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

2022-04-25 Thread German Gomez via Elfutils-devel
Demangle mangled return addresses on AARCH64. The value of the masks is stored in the struct Dwfl_Thread. Signed-off-by: German Gomez --- libdwfl/dwfl_frame.c | 3 +++ libdwfl/frame_unwind.c | 14 +- libdwfl/libdwflP.h | 7 +++ 3 files changed, 23 insertions(+), 1 deletio

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

2022-04-25 Thread German Gomez via Elfutils-devel
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-instructions Signed-off-

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

2022-04-25 Thread German Gomez via Elfutils-devel
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 --- backends/aarch64_init.

[PATCH 0/4] Add AARCH64 pointer authentication support

2022-04-25 Thread German Gomez via Elfutils-devel
Hi, I've included a set of patches in order to demangle return addresses in aarch64 platforms with pointer authentication. Besides adding the implementation of the negate_ra_state opcode, there is a new function in the libdwfl.h header to feed the PAC masks to the library. Let me know if there a