Published August 16, 2024 | Version v1

GhostRace: Exploiting and Mitigating Speculative Race Conditions

  • 1. ROR icon Vrije Universiteit Amsterdam
  • 2. ROR icon IBM Research - Zurich

Description

    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.

Files

usenixsecurity24-ragab.pdf

Files (2.2 MB)

Name Size Download all
md5:0ebccec7cf4c1064128abdddbacfe475
2.2 MB Preview Download

Additional details

Funding

European Commission
RESCALE - Revolutionised Enhanced Supply Chain Automation with Limited Threats Exposure 101120962

Software

Repository URL
https://github.com/vusec/ghostrace
Programming language
SmPL
Development Status
Active