ARM64 Pointer Authentication: Signing Pointers to Block Return-Oriented Attacks
How ARM64 Pointer Authentication Codes (PAC) sign function pointers so attackers cannot reuse them, plus how to check CPU support and enable it in your build.
21 Aug 2025, 21:11 UTC

The problem: reused pointers are reliable exploit primitives
An attacker who can overwrite a return address or function pointer does not need to inject code. They can reuse existing instruction fragments in a technique called return-oriented programming, chaining together gadgets already present in the process. On ARM64, a forged pointer that passes a normal control-flow check can still redirect execution, which makes pointer integrity a practical hardening concern rather than a theoretical one.
What pointer authentication does on ARM64
Pointer Authentication (PAC) is an ARMv8.3-A architectural feature. The CPU signs a pointer with a secret key and stores the signature in the unused high bits of the address. Later, when the pointer is used, the CPU recomputes the signature and faults if it does not match. Because an attacker cannot compute the valid signature without the key, a tampered pointer triggers a fault instead of a jump.
Terms used here: ARMv8.3-A is the ARM architecture version that introduced PAC. Return-oriented programming is an attack style that chains existing code gadgets instead of injecting shellcode. Pointer Authentication Code is the cryptographic tag attached to a pointer.
Check the CPU before you change the build
PAC is not universal across ARM64. Older Cortex-A53 and Cortex-A57 cores implement ARMv8.0-A and do not include the feature. Newer cores such as Cortex-A76 and later often implement ARMv8.3-A or later, but you should confirm the specific SoC rather than assume.
On Linux, inspect the processor feature list:
grep -o 'Features.*' /proc/cpuinfo | head -n 1
Run this in a normal user shell on the target system. No special permissions are required. The exact feature strings vary by kernel release, so cross-reference the output with your SoC technical reference manual for ARMv8.3-A or later and pointer-authentication support.
Worked example: sign a function pointer in the build
You usually do not need to change source code. The compiler can emit signing and authentication instructions when you target an architecture that supports PAC. Consider this C file, saved as program.c:
typedef void (*handler_t)(void);
void target(void) { }
handler_t pick(handler_t a, handler_t b) {
return a ? a : b;
}Compile it to assembly on a build host or the target itself:
gcc -O2 -march=armv8.3-a -mbranch-protection=standard -S program.c -o program.S
Then inspect the emitted instructions:
grep -E 'pacia|autia' program.S
Where to run: a terminal with the compiler installed. Permissions: ordinary user. Expected check: the grep command should return lines containing pacia or autia, indicating the compiler emitted pointer-authentication sign and authenticate instructions. Risk: if you run the resulting binary on a CPU without PAC, those instructions raise SIGILL (illegal instruction), so test on the actual deployment hardware before rolling out.
Trade-offs and limits
- Hardware requirement: ARMv8.3-A or later is required. Binaries built with PAC will fault on older cores.
- Compatibility: Just-in-time compilers, hand-written assembly, and low-level firmware that manufacture pointers at runtime can break when authentication is enforced.
- Performance: overhead is workload-dependent and is highest in pointer-dense code. Measure your latency-sensitive paths rather than assuming a fixed cost.
- Scope: PAC protects pointer integrity; it does not replace stack canaries, ASLR, or memory-safety fixes.
Action: enable it and verify on the target
- Confirm the target SoC implements ARMv8.3-A or later.
- Add
-march=armv8.3-a -mbranch-protection=standardto user-space build flags for GCC or Clang. - Compile with
-Sand grep forpaciaorautiato confirm the compiler emitted PAC instructions. - Run the binary on the target; an immediate
SIGILLmeans the hardware lacks PAC support. - Benchmark pointer-sensitive paths before and after if latency matters.
Pointer authentication is a low-effort hardening step for ARM64 user-space binaries, but it is only as useful as the hardware underneath it. Check the CPU first, verify the assembly second, and deploy only where the target silicon can enforce the signatures.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.