arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2407.15080cs.PLcs.CR
收藏

SNIP:针对编译器变换的推测执行与非干扰保持

SNIP: Speculative Execution and Non-Interference Preservation for Compiler Transformations

Sören van der Wall, Roland Meyer

AI总结:

本文提出基于新模拟关系的证明方法,在推测语义下保持编译器变换的非干扰,发现并自动修复了寄存器分配中的未知安全缺陷,并在 libsodium 上验证。

摘要:

我们研究在推测语义下跨编译器变换保持非干扰的问题。我们提出一种证明方法,确保在所有源程序上一致地保持非干扰。该证明方法的基础是一种新形式的模拟关系。它作用于建模攻击者对微架构状态控制能力的指令,并考虑到编译器变换可能改变微架构状态对执行的影响(从而改变指令)这一事实。利用我们的证明方法,我们证明了死代码消除的正确性。在尝试证明寄存器分配正确时,我们发现了一个此前未知的缺陷,该缺陷会引入对非干扰的违反。我们已在主流编译器上对 libsodium 密码库中的代码确认了该缺陷。为重新获得安全性,我们开发了一种新颖的静态分析,该分析作用于源程序与寄存器分配后程序的乘积。利用该分析,我们提出了对现有寄存器分配实现的自动化修复。我们用证明方法证明了修复后的寄存器分配的正确性。

英文摘要:

We address the problem of preserving non-interference across compiler transformations under speculative semantics. We develop a proof method that ensures the preservation uniformly across all source programs. The basis of our proof method is a new form of simulation relation. It operates over directives that model the attacker's control over the micro-architectural state, and it accounts for the fact that the compiler transformation may change the influence of the micro-architectural state on the execution (and hence the directives). Using our proof method, we show the correctness of dead code elimination. When we tried to prove register allocation correct, we identified a previously unknown weakness that introduces violations to non-interference. We have confirmed the weakness for a mainstream compiler on code from the libsodium cryptographic library. To reclaim security once more, we develop a novel static analysis that operates on a product of source program and register-allocated program. Using the analysis, we present an automated fix to existing register allocation implementations. We prove the correctness of the fixed register allocations with our proof method.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑