A Benchmark Suite for Evaluating Caches' Vulnerability to Timing Attacks

Shuwen Deng, Wenjie Xiong, Jakub Szefer

TL;DR

Researchers from Yale University have developed a comprehensive framework and benchmark suite to systematically evaluate how vulnerable processor caches are to timing-based side-channel attacks. By expanding a theoretical "three-step" attack model, they identified 88 distinct types of vulnerabilities—including 32 previously unknown ones—and created a tool that generates a "Cache Timing Vulnerability Score" (CTVS) to rank the security of different hardware implementations.

What Problem Does This Paper Address?

Cache timing attacks (like those used in Spectre and Meltdown) exploit the fact that accessing data in a fast cache takes less time than fetching it from slow main memory. By observing these timing differences, an attacker can infer sensitive information, such as cryptographic keys.

While many individual attacks and defenses exist, the field has lacked a systematic way to understand every possible way a cache could leak information. Most research focuses on a few well-known techniques (like Prime+Probe or Flush+Reload). This paper addresses the gap between ad-hoc attack discovery and a rigorous, exhaustive security evaluation of modern CPU hardware.

Methods

The authors build upon an existing three-step model for cache attacks:

  1. Initial Step: Set the cache line to a known state.
  2. Modify Step: The victim (or attacker) performs an operation that might change that state.
  3. Observe Step: The attacker measures the timing of a final operation to see what changed.

The "secret sauce" in this paper is the Improved Modeling of Real Processors. Unlike previous theoretical models, this one accounts for:

  • Read vs. Write: It considers that writing to memory can leak information just as much as reading.
  • Local vs. Remote Cores: It models attacks where the victim and attacker are on different cores, utilizing cache coherence protocols to trigger timing variations.
  • Execution Environment: It differentiates between hyper-threading (parallel execution) and time-slicing (interleaved execution).
  • Invalidation Methods: It looks at both the clflush instruction and "remote writes" as ways to clear cache lines.

The team used a Python-based simulator to test all 4,913 possible combinations of the three-step model, narrowing them down to 88 "Strong" vulnerabilities.

Datasets

The primary "dataset" produced is the benchmark suite itself, consisting of 1,094 automatically generated C test programs.

For evaluation, the authors ran these benchmarks on a diverse set of real-world hardware:

  • Intel Processors: Xeon E5-1620, E5-2667, E5-2690, E5-2686, Core i5-4570, and Xeon P-8175 (via Amazon EC2).
  • AMD Processors: FX-8150 and EPYC 7571.

Key Insights and Ideas

  • Writes are Leaky: Most prior work focused on memory reads. This paper proves that memory writes are a highly effective vector for timing observations, sometimes even when reads are defended.
  • Coherence as a Weapon: The researchers showed that cache coherence protocols (the system that keeps data consistent across multiple cores) can be abused to create new types of "remote" timing attacks.
  • Hardware Diversity Matters: A vulnerability that is "Strong" in theory might not be exploitable on a specific CPU if that CPU's hardware timings for a "hit" and a "miss" are too similar to distinguish.
  • The CTVS Metric: By quantifying vulnerabilities into a single score, designers can finally move away from "one-size-fits-all" defenses and instead create hardware-specific patches or software mitigations.

Key Results

  • Discovery: Identified 32 new types of timing-based vulnerabilities not found in previous systematic studies.
  • Empirical Proof: Evaluation on commodity CPUs showed that different architectures are susceptible to different subsets of the 88 vulnerabilities. For example, the AMD FX-8150 generally showed a better (lower) CTVS than the tested Intel Xeon family.
  • Exhaustive Validation: The researchers tested all 4,913 possible three-step combinations on real hardware and confirmed that no effective attacks exist outside of the 88 they derived, proving the completeness of their model for L1 caches.

Limitations and Future Work

  • L1 Focus: The current benchmark suite focuses primarily on the L1 data cache. While the authors suggest the model can be extended to L2, L3, and instruction caches, those levels involve more complex behaviors (like non-inclusive caches or complex replacement policies) that aren't fully captured here.
  • Beyond Timing: The model focuses strictly on timing. It does not account for other side channels like power consumption or electromagnetic radiation.
  • Future Directions: The authors propose using these benchmarks to evaluate future "secure" cache designs in simulators before the hardware is even built, potentially stopping vulnerabilities at the drawing board.

Summary updated

BibTeX
@inproceedings{deng2020benchmark,
  author = {Shuwen Deng and Wenjie Xiong and Jakub Szefer},
  title = {{A Benchmark Suite for Evaluating Caches' Vulnerability to Timing Attacks}},
  booktitle = {ASPLOS},
  year = {2020},
  doi = {10.1145/3373376.3378510},
}
Figure