Theory and Practice of Finding Eviction Sets

Pepe Vila, Boris Köpf, José F. MoralesIEEE Symposium on Security and Privacy 2019 · DOI

TL;DR

This paper tackles the challenge of efficiently finding "eviction sets" – groups of memory addresses that can be used to precisely control the contents of CPU caches. The authors introduce novel, linear-time algorithms that significantly outperform previous quadratic approaches, making these attacks more practical and stealthy. Their work also provides a rigorous empirical analysis of factors affecting these algorithms' reliability, offering crucial insights for both attackers and defenders.

What Problem Does This Paper Address?

Modern CPUs use caches to speed up memory access, but this creates a vulnerability. Side-channel attacks, like those used for Rowhammer or to exploit speculative execution, often rely on an attacker's ability to precisely control specific cache sets. This control is achieved by identifying "eviction sets" – collections of virtual memory addresses that, when accessed, guarantee that a particular cache set is cleared of its previous contents. While the importance of eviction sets is well-established, systematic study of algorithms for finding them, especially minimal eviction sets (the smallest possible), has been lacking. This paper aims to fill that gap by formalizing the problem, developing efficient algorithms, and rigorously evaluating their practical performance and reliability.

Methods

The authors propose a two-pronged approach:

  1. Formalization and Probabilistic Analysis: They begin by formally defining eviction sets and analyzing the probability that a randomly chosen set of virtual addresses constitutes an eviction set. This analysis helps understand the trade-offs between set size and effectiveness, justifying the common two-step approach of first finding a large eviction set and then reducing it.
  2. Novel Linear-Time Algorithms: The core contribution is the development of new algorithms for reducing a large eviction set to its minimal core. These algorithms are inspired by "threshold group testing," a technique used in other fields for efficiently identifying items with a specific property within a larger pool. By framing eviction set testing as a threshold group test, they leverage existing theoretical results to design algorithms that require only O(N) memory accesses, a significant improvement over the O(N²) complexity of prior methods. They also adapt these algorithms for finding eviction sets for arbitrary cache sets, not just specific ones.

Datasets

Not discussed in the paper. The evaluation uses real hardware (Intel Skylake and Haswell CPUs) and dynamically generated memory regions as the "dataset" for testing.

Key Insights and Ideas

  • Eviction Sets are Fundamental: The paper strongly emphasizes that finding eviction sets is a "decisive primitive" for a wide range of sophisticated attacks, making its efficient computation critical.
  • Group Testing is Key: The novel insight is the connection between eviction set testing and threshold group testing. This allows the application of powerful theoretical results from group testing to achieve linear-time complexity.
  • Linear Time is a Game Changer: The shift from quadratic to linear time complexity for eviction set reduction dramatically improves the practicality of these attacks, especially for larger initial sets. This makes attacks feasible even in scenarios previously considered too slow or impractical.
  • Adaptive Policies are a Double-Edged Sword: Modern CPUs use complex, adaptive cache replacement policies. While these can sometimes make eviction less reliable (introducing false positives/negatives), the authors show that targeting specific "leader" sets or using partially congruent addresses can mitigate these effects.
  • TLB Thrashing is a Real Concern: The paper highlights how TLB misses, especially with smaller page sizes, can introduce noise and reduce the reliability of eviction tests, particularly for larger sets.

Key Results

  • Algorithmic Improvement: The authors developed algorithms that reduce the complexity of finding minimal eviction sets from O(N²) to O(N) memory accesses, where N is the size of the initial eviction set.
  • Practical Speedups: Empirical evaluations show speedups of 5-20x in real-world scenarios compared to baseline algorithms. This makes attacks significantly faster and more stealthy.
  • Reliability Analysis: The paper identifies specific conditions (e.g., targeting certain cache sets, using specific page sizes) under which their algorithms are highly reliable, and conversely, conditions where reliability degrades (e.g., due to adaptive replacement policies or TLB thrashing).
  • Countermeasure Futility: The linear-time algorithms are effective even without control over physical address bits (e.g., in sandboxed environments), potentially rendering countermeasures that rely solely on obfuscating these bits less effective.

Limitations and Future Work

  • Adaptive Policies: The paper acknowledges that fully understanding and mitigating the effects of complex adaptive cache replacement policies remains an open challenge. Future work could involve developing better models or control mechanisms for these policies.
  • Noisy Group Testing: Dealing with uncertainty in eviction tests (e.g., due to noise) is an area for future research, potentially leveraging advancements in noisy group testing.
  • Hardware-Specific Nuances: While the study covers Skylake and Haswell, the specific details of cache replacement policies and TLB implementations can vary significantly across different microarchitectures, requiring further investigation.
  • Exploiting Adaptivity: The authors suggest future work could explore exploiting adaptive mechanisms to augment the determinism of certain cache sets, thereby facilitating reductions.

Summary updated

BibTeX
@inproceedings{vila2019theory,
  author = {Pepe Vila and Boris Köpf and José F. Morales},
  title = {{Theory and Practice of Finding Eviction Sets}},
  booktitle = {IEEE Symposium on Security and Privacy},
  year = {2019},
  doi = {10.1109/sp.2019.00042},
}

Loading related content...

Figure