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

真正的常量时间 Wasmtime:面向 Web 及更广领域的端到端验证零开销常量时间编程

Constant-Time Wasmtime, for Real This Time: End-to-End Verified Zero-Overhead Constant-Time Programming for the Web and Beyond

Garrett Gu, Hovav Shacham

AI总结:

针对现有常量时间代码生成与验证工具的不完整性,提出首个端到端常量时间感知编译流程,基于修改的 Wasmtime 将 ct-wasm 编译为 ARM 代码并利用 Ghidra 自动验证,实现零开销且抵御时序泄漏。

摘要:

我们声称,现有的常量时间代码生成与验证技术及工具是不完整的,因为它们依赖于编译器优化过程不会破坏常量时间性,或者某些操作在硬件上以常量时间执行的假设。我们提出了首个端到端的常量时间感知编译流程,该流程在从高级语言到由即将推出的 ARM PSTATE.DIT 特性提供的微架构保证的每一步中,都保持了常量时间语义。首先,我们提出了一套基于 JIT 风格运行时 Wasmtime 的新编译器-验证器套件,经过修改以将 ct-wasm(WebAssembly 的一种现有类型安全常量时间扩展)编译为 ARM 机器代码,同时在所有优化过程中保持常量时间属性。生成的机器代码随后被输入到一个无需人工干预的自动化验证器中,该验证器使用 Ghidra 中的静态数据流分析来检查输出的常量时间性。我们的验证器利用了 ct-wasm 生成代码独有的特性来加速验证,同时保持可靠性和广泛的适用性。我们还考虑了我们的编译和验证对诸如 Spectre 等推测执行时序泄漏的抵抗力。最后,为了在高级层面暴露 ct-Wasmtime,我们提出了对现有的常量时间感知 DSL FaCT 的移植,使其以 ct-wasm 为目标。

英文摘要:

We claim that existing techniques and tools for generating and verifying constant-time code are incomplete, since they rely on assumptions that compiler optimization passes do not break constant-timeness or that certain operations execute in constant time on the hardware. We present the first end-to-end constant-time-aware compilation process that preserves constant-time semantics at every step from a high-level language down to microarchitectural guarantees, provided by the forthcoming ARM PSTATE.DIT feature. First, we present a new compiler-verifier suite based on the JIT-style runtime Wasmtime, modified to compile ct-wasm, a preexisting type-safe constant-time extension of WebAssembly, into ARM machine code while maintaining the constant-time property throughout all optimization passes. The resulting machine code is then fed into an automated verifier that requires no human intervention and uses static dataflow analysis in Ghidra to check the constant-timeness of the output. Our verifier leverages characteristics unique to ct-wasm-generated code in order to speed up verification while preserving both soundness and wide applicability. We also consider the resistance of our compilation and verification against speculative timing leakages such as Spectre. Finally, in order to expose ct-Wasmtime at a high level, we present a port of FaCT, a preexisting constant-time-aware DSL, to target ct-wasm.

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

↑