When pointer authentication is in use, data/instruction pointers have a number of PAC bits inserted into them. The number and position of these bits depends on the configured TCR_ELx.TxSZ and whether tagging is enabled. ARMv8.3 allows tagging to differ for instruction and data pointers. For userspace debuggers to unwind the stack and/or to follow pointer chains, they need to be able to remove the PAC bits before attempting to use a pointer. This patch adds a new structure with masks describing the location of the PAC bits in userspace instruction and data pointers (i.e. those addressable via TTBR0), which userspace can query via PTRACE_GETREGSET. By clearing these bits from pointers (and replacing them with the value of bit 55), userspace can acquire the PAC-less versions. This new regset is exposed when the kernel is built with (user) pointer authentication support, and the address authentication feature is enabled. Otherwise, the regset is hidden.
Showing the changes to include/uapi/linux (1 of 6 files). Show all
Unified · Split
| @@ -420,6 +420,7 @@ typedef struct elf64_shdr { · 419 unmodified lines | |||
| 420 | #define NT_ARM_HW_WATCH 0x403 /* ARM hardware watchpoint registers */ | 420 | #define NT_ARM_HW_WATCH 0x403 /* ARM hardware watchpoint registers */ |
| 421 | #define NT_ARM_SYSTEM_CALL 0x404 /* ARM system call number */ | 421 | #define NT_ARM_SYSTEM_CALL 0x404 /* ARM system call number */ |
| 422 | #define NT_ARM_SVE 0x405 /* ARM Scalable Vector Extension registers */ | 422 | #define NT_ARM_SVE 0x405 /* ARM Scalable Vector Extension registers */ |
| 423 | #define NT_ARM_PAC_MASK 0x406 /* ARM pointer authentication code masks */ | ||
| 423 | #define NT_ARC_V2 0x600 /* ARCv2 accumulator/extra registers */ | 424 | #define NT_ARC_V2 0x600 /* ARCv2 accumulator/extra registers */ |
| 424 | #define NT_VMCOREDD 0x700 /* Vmcore Device Dump Note */ | 425 | #define NT_VMCOREDD 0x700 /* Vmcore Device Dump Note */ |
| 425 | #define NT_MIPS_DSP 0x800 /* MIPS DSP ASE registers */ | 426 | #define NT_MIPS_DSP 0x800 /* MIPS DSP ASE registers */ |