Speculation Invariance (InvarSpec): Faster Safe Execution Through Program Analysis
Zirui Neil Zhao, Houxiang Ji, Mengjia Yan, Jiyong Yu, Christopher W. Fletcher, Adam Morrison, Darko Marinov, Josep Torrellas
Abstract
Many hardware-based defense schemes against speculative execution attacks use special mechanisms to protect instructions while speculative, and lift the mechanisms when the instructions turn non-speculative. In this paper, we observe that speculative instructions can sometimes become Speculation Invariant before turning non-speculative. Speculation invariance means that (i) whether the instruction will execute and (ii) the instruction's operands are not a function of speculative state. Hence, we propose to lift the protection mechanisms on these instructions early, when they become speculation invariant, and issue them without protection. As a result, we improve the performance of the defense schemes without changing their security properties.
To exploit speculation invariance, we present the InvarSpec framework. InvarSpec includes a program analysis pass that identifies, for each relevant instruction i, the set of older instructions that are Safe for i-i.e., those that do not prevent i from becoming speculation invariant. At runtime, the InvarSpec micro-architecture loads this information and uses it to determine when speculative instructions can be issued without protection. InvarSpec is one of the first defense schemes for speculative execution that combines cooperative compiler and hardware mechanisms. Our evaluation shows that InvarSpec effectively reduces the execution overhead of hardware defense schemes. For example, on SPEC17, it reduces the average execution overhead of fence protections from 195.3% to 108.2%, of Delay-On-Miss from 39.5% to 24.4%, and of InvisiSpec from 15.4% to 10.9%.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
12 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- Doppelganger Loads: A Safe, Complexity-Effective Optimization for Secure Speculation Schemes cites Spectre Attacks: Exploiting Speculative Execution
- Doppelganger Loads: A Safe, Complexity-Effective Optimization for Secure Speculation Schemes cites ZombieLoad: Cross-Privilege-Boundary Data Sampling
- Doppelganger Loads: A Safe, Complexity-Effective Optimization for Secure Speculation Schemes cites I See Dead µops: Leaking Secrets via Intel/AMD Micro-Op Caches
- Doppelganger Loads: A Safe, Complexity-Effective Optimization for Secure Speculation Schemes cites DOLMA: Securing Speculation with the Principle of Transient Non-Observability
- Doppelganger Loads: A Safe, Complexity-Effective Optimization for Secure Speculation Schemes cites Pinned loads: taming speculative loads in secure processors
- ZombieLoad: Cross-Privilege-Boundary Data Sampling cites Spectre Attacks: Exploiting Speculative Execution
- RIDL: Rogue In-Flight Data Load cites Spectre Attacks: Exploiting Speculative Execution
- RIDL: Rogue In-Flight Data Load cites Meltdown: Reading Kernel Memory from User Space
- RIDL: Rogue In-Flight Data Load cites Foreshadow: Extracting the Keys to the Intel SGX Kingdom with Transient Out-of-Order Execution
- Meltdown: Reading Kernel Memory from User Space cites Spectre Attacks: Exploiting Speculative Execution
- I See Dead µops: Leaking Secrets via Intel/AMD Micro-Op Caches cites Spectre Attacks: Exploiting Speculative Execution
- I See Dead µops: Leaking Secrets via Intel/AMD Micro-Op Caches cites ZombieLoad: Cross-Privilege-Boundary Data Sampling
- I See Dead µops: Leaking Secrets via Intel/AMD Micro-Op Caches cites RIDL: Rogue In-Flight Data Load
- I See Dead µops: Leaking Secrets via Intel/AMD Micro-Op Caches cites Meltdown: Reading Kernel Memory from User Space
- I See Dead µops: Leaking Secrets via Intel/AMD Micro-Op Caches cites Foreshadow: Extracting the Keys to the Intel SGX Kingdom with Transient Out-of-Order Execution
- I See Dead µops: Leaking Secrets via Intel/AMD Micro-Op Caches cites DOLMA: Securing Speculation with the Principle of Transient Non-Observability
- Foreshadow: Extracting the Keys to the Intel SGX Kingdom with Transient Out-of-Order Execution cites Spectre Attacks: Exploiting Speculative Execution
- DOLMA: Securing Speculation with the Principle of Transient Non-Observability cites Spectre Attacks: Exploiting Speculative Execution
- DOLMA: Securing Speculation with the Principle of Transient Non-Observability cites ZombieLoad: Cross-Privilege-Boundary Data Sampling
- DOLMA: Securing Speculation with the Principle of Transient Non-Observability cites RIDL: Rogue In-Flight Data Load
- DOLMA: Securing Speculation with the Principle of Transient Non-Observability cites Meltdown: Reading Kernel Memory from User Space
- DOLMA: Securing Speculation with the Principle of Transient Non-Observability cites Foreshadow: Extracting the Keys to the Intel SGX Kingdom with Transient Out-of-Order Execution
- Pinned loads: taming speculative loads in secure processors cites Spectre Attacks: Exploiting Speculative Execution
- Pinned loads: taming speculative loads in secure processors cites ZombieLoad: Cross-Privilege-Boundary Data Sampling
- Pinned loads: taming speculative loads in secure processors cites RIDL: Rogue In-Flight Data Load
- Pinned loads: taming speculative loads in secure processors cites Meltdown: Reading Kernel Memory from User Space
- Pinned loads: taming speculative loads in secure processors cites Foreshadow: Extracting the Keys to the Intel SGX Kingdom with Transient Out-of-Order Execution
Cited by top-tier papers12
- DOLMA: Securing Speculation with the Principle of Transient Non-ObservabilityKevin Loughlin, Ian Neal, Jiacheng Ma, Elisa Tsai et al.USENIX Security 2021 · 94 citations
- I See Dead µops: Leaking Secrets via Intel/AMD Micro-Op CachesXida Ren, Logan Moody, Mohammadkazem Taram, Matthew Jordan et al.ISCA 2021 · 59 citations
- DAGguise: mitigating memory timing side channelsPeter W. Deutsch, Yuheng Yang, Thomas Bourgeat, Jules Drean et al.ASPLOS 2022 · 19 citations
- Doppelganger Loads: A Safe, Complexity-Effective Optimization for Secure Speculation SchemesAmund Bergland Kvalsvik, Pavlos Aimoniotis, Stefanos Kaxiras, Magnus SjälanderISCA 2023 · 9 citations
- Pinned loads: taming speculative loads in secure processorsZirui Neil Zhao, Houxiang Ji, Adam Morrison, Darko Marinov et al.ASPLOS 2022 · 8 citations
Builds on9
- Spectre Attacks: Exploiting Speculative ExecutionPaul Kocher, Jann Horn, Anders Fogh, Daniel Genkin et al.S&P 2019 · 2,435 citations
- Meltdown: Reading Kernel Memory from User SpaceMoritz Lipp, Michael Schwarz, Daniel Gruss, Thomas Prescher et al.USENIX Security 2018 · 1,456 citations
- Foreshadow: Extracting the Keys to the Intel SGX Kingdom with Transient Out-of-Order ExecutionJo Van Bulck, Marina Minkin, Ofir Weisse, Daniel Genkin et al.USENIX Security 2018 · 1,175 citations
- ZombieLoad: Cross-Privilege-Boundary Data SamplingMichael Schwarz, Moritz Lipp, Daniel Moghimi, Jo Van Bulck et al.CCS 2019 · 464 citations
- RIDL: Rogue In-Flight Data LoadStephan van Schaik, Alyssa Milburn, Sebastian Österlund, Pietro Frigo et al.S&P 2019 · 408 citations
Related papers
- Levioso: Efficient Compiler-Informed Secure SpeculationAli Hajiabadi, Archit Agarwal, Andreas Diavastos, Trevor E. CarlsonDAC 2024 · 1 citation
- Speculative Data-Oblivious Execution: Mobilizing Safe Prediction For Safe and Efficient Speculative ExecutionJiyong Yu, Namrata Mantri, Josep Torrellas, Adam Morrison et al.ISCA 2020 · 50 citations
- Speculative interference attacks: breaking invisible speculation schemesMohammad Behnia, Prateek Sahu, Riccardo Paccagnella, Jiyong Yu et al.ASPLOS 2021 · 69 citations
- Speculative Privacy Tracking (SPT): Leaking Information From Speculative Execution Without Compromising PrivacyRutvik Choudhary, Jiyong Yu, Christopher W. Fletcher, Adam MorrisonMICRO 2021 · 33 citations
- Pensieve: Microarchitectural Modeling for Security EvaluationYuheng Yang, Thomas Bourgeat, Stella Lau, Mengjia YanISCA 2023 · 23 citations
