A Benchmark Suite for Evaluating Caches' Vulnerability to Timing Attacks

Shuwen Deng, Wenjie Xiong, Jakub Szefer

A Benchmark Suite for Evaluating Caches' Vulnerability to Timing Attacks

Introduction

Modern processor architectures rely heavily on cache hierarchies to bridge the performance gap between fast CPUs and slower main memory. However, this optimization introduces a significant security risk: timing-based side-channel attacks. By observing the time required to access data, an attacker can infer whether a specific memory address was cached, potentially leaking sensitive information such as cryptographic keys. While well-known attacks like Spectre and Meltdown have highlighted these risks, the industry has lacked a systematic framework to evaluate the full spectrum of cache vulnerabilities across diverse hardware. Researchers from Yale University have addressed this gap by developing a comprehensive benchmark suite and a quantitative metric called the Cache Timing Vulnerability Score (CTVS).

Systematic Modeling of Cache Attacks

The researchers expanded upon the traditional "three-step" attack model—comprising an Initial state setup, a victim Modify step, and an attacker Observe step. Unlike previous theoretical models that focused primarily on memory reads, this new framework incorporates several real-world complexities:

  • Read vs. Write Operations: The model recognizes that memory writes can leak information just as effectively as reads.
  • Cache Coherence Protocols: It accounts for multi-core environments where coherence traffic between local and remote cores can trigger timing variations.
  • Execution Contexts: The framework differentiates between simultaneous multithreading (hyper-threading) and time-sliced execution.
  • Invalidation Mechanisms: It evaluates both explicit instructions (like clflush) and implicit methods (like remote writes) for clearing cache lines.

Using a Python-based simulator, the team analyzed 4,913 possible combinations of these steps, identifying 88 "Strong" vulnerabilities, 32 of which were previously undocumented.

Empirical Evaluation and Hardware Diversity

To validate the model, the researchers generated a benchmark suite of 1,094 C programs and executed them on a variety of Intel and AMD processors. The results demonstrated that vulnerability is not just a theoretical property but is highly dependent on specific hardware implementations.

Timing distributions for read, write, and flush operations on Intel Xeon processors, illustrating how different operations and architectures produce distinct timing signatures used to calculate CTVS.

As shown in the timing data, different operations (read, write, flush) produce distinct latency distributions. A vulnerability is considered "Strong" only if the timing difference between a cache hit and a miss is statistically significant enough to be distinguished by an attacker. The study found that while some vulnerabilities are universal, others are specific to certain microarchitectures. For instance, the AMD FX-8150 generally exhibited a lower (more secure) CTVS compared to the Intel Xeon processors tested.

Key Findings

  1. The Leakiness of Writes: The study confirmed that memory writes are a potent attack vector. In some scenarios, writes remained exploitable even when read-based defenses were active.
  2. Coherence as an Attack Vector: Cache coherence protocols, designed for data consistency, can be weaponized to create "remote" timing attacks across different CPU cores.
  3. Quantifiable Security: The CTVS provides a standardized way for hardware designers to measure and rank the security of different cache implementations, moving beyond ad-hoc vulnerability discovery.

Conclusion and Future Directions

This research provides the first exhaustive mapping of L1 data cache timing vulnerabilities. By providing a tool to automatically generate benchmarks and calculate security scores, the authors enable a more proactive approach to hardware security. Future work aims to extend this model to L2 and L3 caches, which involve more complex replacement policies and non-inclusive behaviors, as well as exploring non-timing side channels like power and electromagnetic emissions.

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