In-Kernel Control-Flow Integrity on Commodity OSes using ARM Pointer Authentication

Sungbae Yoo, Jinbum Park, Seolheui Kim, Yeji Kim, Taesoo Kim

TL;DR

PAL (Pointer Authentication Layer) is a new hardware-based security framework that brings high-precision Control-Flow Integrity (CFI) to commodity kernels like Linux and FreeBSD. By leveraging ARM’s Pointer Authentication (PA) hardware and a novel "static validator," PAL achieves significantly better security than existing commercial solutions with negligible performance overhead (often <1%).

What Problem Does This Paper Address?

Modern operating systems are under constant siege from memory corruption vulnerabilities. Even with defenses like KASLR and DEP, attackers use techniques like Return-Oriented Programming (ROP) and Jump-Oriented Programming (JOP) to hijack a program's "control flow"—essentially forcing the CPU to execute code in an unintended order.

Control-Flow Integrity (CFI) is the gold standard for stopping these attacks by ensuring the CPU only jumps to valid, pre-defined targets. However, implementing CFI in an OS kernel is notoriously difficult. Software-based CFI is often too slow, while existing hardware-based approaches (like Apple’s implementation in iOS) sometimes sacrifice precision for compatibility or fall victim to subtle "hindsight" attacks, such as hijacking a pointer during a kernel preemption (when the OS pauses one task to start another).

Methods

The authors introduce PAL, which secures the kernel using three main components:

  1. Context Analyzer: This tool automatically scans kernel source code to identify "design idioms"—common patterns like reference counting or object-oriented structures in C. It uses these patterns to generate "contexts" (cryptographic nonces) that make pointers unique. For example, instead of just signing a function pointer by its type, PAL can bind it to the specific kernel object it belongs to (objbind) or the specific API that called it (retbind).
  2. Kernel & Compiler Instrumentation: PAL uses a GCC plugin to insert ARM PA instructions (PAC to sign and AUT to verify). To solve the "preemption hijacking" problem, they developed Timebind, which uses the hardware's physical timer as a unique, unforgeable context to sign the entire CPU state during an interrupt.
  3. Static Validator: This is perhaps the most novel part. Compilers are complex and can sometimes "optimize away" security checks. The Static Validator analyzes the final compiled binary to ensure no "signing oracles" (code snippets that let an attacker sign their own pointers) or "TOCTOU" (time-of-check to time-of-use) vulnerabilities were accidentally introduced.

Datasets

The researchers evaluated PAL on two primary hardware platforms:

  • Apple Mac mini (M1 chip): Running Asahi Linux.
  • Raspberry Pi 3: Running Tizen 5.5 (Linux) and FreeBSD 11.0.

They used a comprehensive suite of industry-standard benchmarks to measure performance and precision:

  • SPEC2006: For general CPU performance.
  • LMbench & perf: For kernel-specific latencies (system calls, context switching).
  • Apache Benchmark: For real-world network throughput.
  • LevelDB & Blogbench: For database and file system performance.

Key Insights and Ideas

  • The Compiler is Not Your TCB: The authors realized that even if your source code is secure, the compiler's back-end optimizations can create security holes. Their Static Validator found new attack vectors in the actual iOS kernel, proving that binary-level auditing is essential for PA-based security.
  • Leveraging Kernel Idioms: Most CFI schemes are "context-insensitive," meaning they treat all functions of the same type as interchangeable. PAL proves that by understanding how kernels are written (e.g., how drivers use structures), you can drastically reduce the number of valid jump targets an attacker can exploit.
  • Hardware is the Key to Performance: By offloading the cryptographic signing to ARM's specialized hardware (the QARMA block cipher), PAL provides "fine-grained" protection that would be prohibitively slow if done purely in software.

Key Results

  • Superior Precision: In Linux, PAL ensured that 90.8% of indirect calls had 5 or fewer valid targets. For comparison, Google’s current CFI for Android only manages this for 55% of calls.
  • Negligible Overhead: On the M1 Mac mini, PAL’s overhead was almost invisible—less than 1% for the Apache web server benchmark and roughly 3–5% for intensive kernel scheduling tasks.
  • Real-World Security: The system successfully blocked exploits for three major known vulnerabilities (CVEs) in Linux and FreeBSD. Furthermore, the Static Validator identified 5 previously unknown violations in the iOS kernel's CFI implementation.

Limitations and Future Work

While PAL is highly automated, it isn't a "silver bullet" that requires zero effort. The authors note that some "low-diversity" code areas still require manual annotation to reach maximum security. Additionally, the Static Validator currently produces about 100 false positives on a full kernel image, requiring a security expert roughly two days of manual review to clear.

Future work aims to improve the static analysis to reduce these false alarms and to extend the PA-based approach to protect against "data-oriented" attacks, which manipulate program data rather than just the execution path.

Summary updated

BibTeX
@inproceedings{yoo2022kernel,
  author = {Sungbae Yoo and Jinbum Park and Seolheui Kim and Yeji Kim and Taesoo Kim},
  title = {{In-Kernel Control-Flow Integrity on Commodity OSes using ARM Pointer Authentication}},
  booktitle = {USENIX Security},
  year = {2022},
  url = {https://openreview.net/forum?id=JtnMwPVH5T},
}
Figure