Lune

USENIX Security2024Top-tier venue

GhostRace: Exploiting and Mitigating Speculative Race Conditions

Hany Ragab, Andrea Mambretti, Anil Kurmus, Cristiano Giuffrida

Abstract

Race conditions arise when multiple threads attempt to access a shared resource without proper synchronization, often leading to vulnerabilities such as concurrent use-after-free. To mitigate their occurrence, operating systems rely on synchronization primitives such as mutexes, spinlocks, etc. In this paper, we present GhostRace, the first security analysis of these primitives on speculatively executed code paths. Our key finding is that all the common synchronization primitives can be microarchitecturally bypassed on speculative paths, turning all architecturally race-free critical regions into Speculative Race Conditions (SRCs). To study the severity of SRCs, we focus on Speculative Concurrent Use-After-Free (SCUAF) and uncover 1,283 potentially exploitable gadgets in the Linux kernel. Moreover, we demonstrate that SCUAF information disclosure attacks against the kernel are not only practical, but that their reliability can closely match that of traditional Spectre attacks, with our proof of concept leaking kernel memory at 12 KB/s. Crucially, we develop a new technique to create an unbounded race window, accommodating an arbitrary number of SCUAF invocations required by an end-to-end attack in a single race window. To address the new attack surface, we also propose a generic SRC mitigation to harden all the affected synchronization primitives on Linux. Our mitigation requires minimal kernel changes and incurs only ≈5% geomean performance overhead on LMBench.

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.

4 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • SMoTherSpectre: Exploiting Speculative Execution through Port Contention cites Spectre Attacks: Exploiting Speculative Execution
  • SMoTherSpectre: Exploiting Speculative Execution through Port Contention cites Meltdown: Reading Kernel Memory from User Space
  • Sharing is leaking: blocking transient-execution attacks with core-gapped confidential VMs cites Spectre Attacks: Exploiting Speculative Execution
  • Sharing is leaking: blocking transient-execution attacks with core-gapped confidential VMs cites RIDL: Rogue In-Flight Data Load
  • Sharing is leaking: blocking transient-execution attacks with core-gapped confidential VMs cites Meltdown: Reading Kernel Memory from User Space
  • Sharing is leaking: blocking transient-execution attacks with core-gapped confidential VMs cites InSpectre Gadget: Inspecting the Residual Attack Surface of Cross-privilege Spectre v2
  • 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
  • Meltdown: Reading Kernel Memory from User Space cites Spectre Attacks: Exploiting Speculative Execution
  • MileSan: Detecting Exploitable Microarchitectural Leakage via Differential Hardware-Software Taint Tracking cites Spectre Attacks: Exploiting Speculative Execution
  • MileSan: Detecting Exploitable Microarchitectural Leakage via Differential Hardware-Software Taint Tracking cites SMoTherSpectre: Exploiting Speculative Execution through Port Contention
  • MileSan: Detecting Exploitable Microarchitectural Leakage via Differential Hardware-Software Taint Tracking cites RIDL: Rogue In-Flight Data Load
  • InSpectre Gadget: Inspecting the Residual Attack Surface of Cross-privilege Spectre v2 cites Spectre Attacks: Exploiting Speculative Execution
  • InSpectre Gadget: Inspecting the Residual Attack Surface of Cross-privilege Spectre v2 cites SMoTherSpectre: Exploiting Speculative Execution through Port Contention
  • InSpectre Gadget: Inspecting the Residual Attack Surface of Cross-privilege Spectre v2 cites RIDL: Rogue In-Flight Data Load
  • InSpectre Gadget: Inspecting the Residual Attack Surface of Cross-privilege Spectre v2 cites Meltdown: Reading Kernel Memory from User Space
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers4

  1. InSpectre Gadget: Inspecting the Residual Attack Surface of Cross-privilege Spectre v2Sander Wiebing, Alvise de Faveri Tron, Herbert Bos, Cristiano GiuffridaUSENIX Security 2024 · 32 citations
  2. Sharing is leaking: blocking transient-execution attacks with core-gapped confidential VMsCharly Castes, Andrew BaumannASPLOS 2024 · 2 citations
  3. Cross-Cache Attacks for the Linux Kernel via PCP MassagingClaudio Migliorelli, Andrea Mambretti, Alessandro Sorniotti, Vittorio Zaccaria et al.NDSS 2026
  4. MileSan: Detecting Exploitable Microarchitectural Leakage via Differential Hardware-Software Taint TrackingTobias Kovats, Flavien Solt, Katharina Ceesay-Seitz, Kaveh RazaviCCS 2025

Builds on34

  1. Spectre Attacks: Exploiting Speculative ExecutionPaul Kocher, Jann Horn, Anders Fogh, Daniel Genkin et al.S&P 2019 · 2,435 citations
  2. Meltdown: Reading Kernel Memory from User SpaceMoritz Lipp, Michael Schwarz, Daniel Gruss, Thomas Prescher et al.USENIX Security 2018 · 1,456 citations
  3. RIDL: Rogue In-Flight Data LoadStephan van Schaik, Alyssa Milburn, Sebastian Österlund, Pietro Frigo et al.S&P 2019 · 408 citations
  4. Hawkeye: Towards a Desired Directed Grey-box FuzzerHongxu Chen, Yinxing Xue, Yuekang Li, Bihuan Chen et al.CCS 2018 · 335 citations
  5. SMoTherSpectre: Exploiting Speculative Execution through Port ContentionAtri Bhattacharyya, Alexandra Sandulescu, Matthias Neugschwandtner, Alessandro Sorniotti et al.CCS 2019 · 267 citations

Related papers

  1. Kasper: Scanning for Generalized Transient Execution Gadgets in the Linux KernelBrian Johannesmeyer, Jakob Koschel, Kaveh Razavi, Herbert Bos et al.NDSS 2022
  2. Speculative Probing: Hacking Blind in the Spectre EraEnes Göktas, Kaveh Razavi, Georgios Portokalidis, Herbert Bos et al.CCS 2020 · 36 citations
  3. An Analysis of Speculative Type Confusion Vulnerabilities in the WildOfek Kirzner, Adam MorrisonUSENIX Security 2021 · 40 citations
  4. ExpRace: Exploiting Kernel Races through Raising InterruptsYoochan Lee, Changwoo Min, Byoungyoung LeeUSENIX Security 2021 · 40 citations
  5. Spectre on RISC-V Silicon: Attacks and Defenses on Commercial Out-of-Order ProcessorsLukas Gerlach, Marton Bognar, Daniel Weber, Michael Schwarz et al.USENIX Security 2026
Dusk over the sea between two cliffs drawn in fine vertical lines