一句话:提出安全编译 lifting 框架,将 Spectre 防御的安全保证从弱推测语义提升到强推测语义,无需新证明。
主流编译器的 Spectre 防御常缺乏形式化保证,或仅在忽略部分推测机制的弱推测语义下得到证明。理想的安全证明应覆盖现代 CPU 全部推测机制,但这需要为新增机制重做安全编译证明。本文提出安全编译 lifting 框架,可将防御的安全保证从弱推测语义提升到强推测语义,而无需新的证明。基于该框架,作者分析了主流编译器的 9 种 Spectre 防御与 5 类攻击,并在考虑 5 种推测机制的语义下证明其安全性。结果显示,fence 与 retpoline 类防御可安全提升至所研究的最强语义,而 speculative load hardening 类防御无法提升到支持间接跳转推测的语义。
Mainstream compilers implement different countermeasures to prevent specific classes of speculative execution attacks. Unfortunately, these countermeasures either lack formal guarantees or come with proofs restricted to speculative semantics capturing only a subset of the speculation mechanisms supported by modern CPUs, thereby limiting their practical applicability. Ideally, these security proofs should target a speculative semantics capturing the effects of all speculation mechanisms implemented in modern CPUs. However, this is impractical and requires new secure compilation proofs to support additional speculation mechanisms. In this paper, we address this problem by proposing a novel secure compilation framework that allows lifting the security guarantees provided by Spectre countermeasures from weaker speculative semantics (ignoring some speculation mechanisms) to stronger ones (accounting for the omitted mechanisms) without requiring new secure compilation proofs. Using our lifting framework, we performed the most comprehensive security analysis of Spectre countermeasures implemented in mainstream compilers to date. Our analysis spans 9 different countermeasures against 5 classes of Spectre attacks, which we proved secure against a speculative semantics accounting for 5 different speculation mechanisms. Our analysis highlights that fence-based and retpoline-based countermeasures can be securely lifted to the strongest speculative semantics under study. In contrast, countermeasures based on speculative load hardening cannot be securely lifted to semantics supporting indirect jump speculation.
DOI 原文 · arXiv · PDF(开放获取) · DBLP
@article{FabianPGB25,
title = {Do You Even Lift? Strengthening Compiler Security Guarantees against Spectre Attacks},
author = {Xaver Fabian and Marco Patrignani and Marco Guarnieri and Michael Backes},
journal = {Proceedings of the ACM on Programming Languages},
volume = {9},
number = {POPL},
year = {2025},
doi = {10.1145/3704867}
}