Abstract
Modern operating system kernels are primary targets for code-reuse attacks, such as Return-Oriented Programming (ROP) and Jump-Oriented Programming (JOP). While Control Flow Integrity (CFI) is a standard defense, software-only implementations often suffer from performance overhead or coarse-grained precision. This paper introduces PATTER (Pointer AuThenTication for kERnels), the first open-source framework to leverage ARMv8.3 Pointer Authentication (PA) hardware for comprehensive kernel protection. PATTER enforces fine-grained forward-edge and backward-edge CFI by binding pointer signatures to their memory addresses, effectively preventing pointer substitution attacks.
Introduction
Despite defenses like Data Execution Prevention (DEP), attackers can still hijack execution flow by chaining existing code gadgets. Control Flow Integrity (CFI) mitigates this by ensuring jumps only target intended locations. However, implementing CFI in the kernel is challenging due to the kernel's role as the "root of trust" and the complexity of its boot process.
ARMv8.3 introduced Pointer Authentication (PA), which uses cryptographic hashes (PACs) stored in unused pointer bits to verify integrity. PATTER extends this hardware capability to the Linux kernel, addressing the critical "pointer substitution" vulnerability where an attacker replaces one validly signed pointer with another of the same type.
System Architecture and Methodology
PATTER employs a multi-stage approach spanning compile-time instrumentation and runtime initialization.
Address-Based PAC
Standard PA implementations typically use a pointer's type as context for the cryptographic signature. PATTER improves upon this by using the virtual address of the pointer variable itself as the context. This ensures that every pointer instance is unique; a signed pointer for one variable cannot be maliciously moved to another memory location, even if the target function type is identical.
The Piggyback Mechanism
A significant challenge in address-based signing is maintaining the context (the original storage address) when a pointer is passed between functions. PATTER solves this through a "piggybacking" technique. Since ARM64 uses a 48-bit virtual address space, the upper bits of a 64-bit pointer are often unused. PATTER utilizes these bits to store metadata.
As shown in the figure, PATTER encodes 14 bits for function identification and 7 bits for the PAC directly into the pointer. This allows the security context to propagate across the kernel without requiring auxiliary memory lookups, maintaining performance.
LLVM and Runtime Integration
The system integrates into the LLVM compiler toolchain. Custom passes identify function pointers and insert pacia (sign) instructions before stores and autia or blraa (verify and branch) instructions before loads and branches. Because hardware keys are unavailable during the early boot phase, a runtime component patches statically initialized pointers once the cryptographic environment is ready.
Evaluation
The researchers evaluated PATTER on Linux kernel 5.0.1 using ARMv8-A Fixed Virtual Platforms (FVP).
- Security: PATTER achieved 100% coverage, protecting all indirect call sites and return addresses within the kernel. The use of atomic instructions like
blraaprevents Time-of-Check to Time-of-Use (TOCTTOU) attacks. - Performance: Using the Unixbench suite, PATTER demonstrated a performance overhead between 15% and 25%. While higher than coarse-grained software CFI, this is a competitive trade-off for hardware-enforced, fine-grained security.
- Binary Size: The instrumentation resulted in a modest 7.0% increase in the kernel image size.
Conclusion
PATTER demonstrates that hardware-assisted pointer authentication can provide robust, fine-grained CFI for the Linux kernel. By binding signatures to memory addresses and utilizing a clever piggybacking scheme, it closes the gap on pointer substitution attacks. Future work will focus on optimizing LLVM passes to reduce overhead and exploring atomic "load-and-authenticate" primitives to further harden data pointer integrity.
Summary updated