NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

PhantomCache: Obfuscating Cache Conflicts with Localized Randomization

Qinhan Tan, Zhihua Zeng, Kai Bu, Kui RenNDSS 2020

Introduction

Modern processors rely on Last-Level Caches (LLCs) to bridge the performance gap between fast CPU cores and slower main memory. To ensure efficiency, these caches traditionally use deterministic mapping, where a specific memory address always maps to a single, predictable "set" in the cache. While optimized for speed, this predictability creates a significant security vulnerability: cache timing attacks.

The Vulnerability: Deterministic Cache Mapping

Attackers exploit cache determinism through conflict-based timing attacks, such as Prime+Probe. In this scenario, an attacker fills a specific cache set with their own data ("Prime") and later measures the time it takes to re-access that data ("Probe"). If the access is slow, it indicates a cache miss, meaning a victim process must have accessed the same set and evicted the attacker's data. By monitoring these conflicts, attackers can reconstruct sensitive information, including cryptographic keys like AES.

The Prime+Probe attack mechanism: (a) shows a cache miss indicating victim access, while (b) shows a cache hit indicating no access.

Existing defenses often attempt to randomize these mappings. However, they typically fall into two traps: "Global Randomization" is too computationally expensive for standard memory access, and "Dynamic Remapping" (periodically changing keys) often incurs high performance overhead or can be outpaced by modern, high-speed eviction-set discovery algorithms.

The Solution: Localized Randomization

PhantomCache introduces a novel middle ground called Localized Randomization. Instead of mapping an address to one fixed set or allowing it to reside anywhere in the cache, PhantomCache maps each address to a small, randomized group of candidate sets (typically $r=8$).

How It Works

  1. Placement: When a data block is brought into the LLC, the hardware randomly selects one of the 8 candidate sets for storage.
  2. Parallel Search: To maintain performance, when the CPU requests data, it searches all 8 candidate sets simultaneously. Because modern LLCs are multi-banked, these searches can occur in parallel across different hardware banks, minimizing latency.
  3. Hardware-Efficient Hashing: The system utilizes a single-cycle LFSR-based Toeplitz hash with random "salts" generated at boot time. This ensures the mapping remains unpredictable to an external observer.
The PhantomCache operational flow, highlighting candidate set computation and parallel search mechanisms.

Unlike previous solutions, PhantomCache does not require periodic remapping. The inherent uncertainty of the initial placement is sufficient to break the mathematical foundations of current cache attacks.

Security and Performance Analysis

The primary strength of PhantomCache lies in the complexity blowup it imposes on attackers. To succeed, an attacker must find a "minimal eviction set"—a group of addresses guaranteed to conflict with the victim. In PhantomCache, even if an attacker identifies the correct addresses, each address only has a $1/r$ chance of being in the target set at any given time. This creates an exponential increase in the work required ($O(r^m)$, where $m$ is the cache associativity).

Key results from evaluations using the ChampSim simulator and SPEC CPU 2017 benchmarks include:

  • Security: Finding a minimal eviction set on a standard 16-way LLC would take an attacker over 500 years. Brute-forcing the hardware salts would take approximately 136 years.
  • Performance: The average performance degradation is remarkably low, measured at just 1.20% for individual benchmarks and 0.50% for mixed server-style workloads.
  • Efficiency: PhantomCache is significantly more efficient than previous state-of-the-art defenses like ScatterCache, offering 2x better performance efficiency and 9x better storage efficiency (requiring only 3 extra bits per cache line).

Conclusion

PhantomCache demonstrates that "good enough" randomness, when applied locally and efficiently, can provide robust security against sophisticated side-channel attacks. By making the discovery of eviction sets computationally impossible within a human lifetime, it secures the LLC without the heavy performance or architectural costs associated with global randomization or frequent remapping.

Summary updated

BibTeX
@inproceedings{tan2020phantomcache,
  author = {Qinhan Tan and Zhihua Zeng and Kai Bu and Kui Ren},
  title = {{PhantomCache: Obfuscating Cache Conflicts with Localized Randomization}},
  booktitle = {NDSS},
  year = {2020},
}
Figure