一句话:提出基于类型分析与寄存器分配的编译期方法,消除代码生成引入的功耗侧信道泄漏。
现代编译器的代码生成模块因 CPU 寄存器数量有限,需将大量程序变量映射到少量寄存器或内存位置,这可能使即使已部署最新防护的软件仍产生功耗侧信道泄漏。本文提出一种基于程序分析与变换的方法来消除此类泄漏。该方法包含两部分:一是基于类型的泄漏检测技术,利用 Datalog 声明式分析与领域特定优化,实现高效且准确的泄漏识别;二是面向编译器后端(尤其是寄存器分配模块)的缓解技术,确保泄漏的中间计算结果被存放在不同的 CPU 寄存器或内存位置。作者在 LLVM 中针对 x86 指令集架构实现并评估了该方法。在密码学软件上的实验表明,该方法能有效消除侧信道且效率高,经其缓解的代码比现有最先进技术缓解后的代码更紧凑、运行更快。
The code generation modules inside modern compilers, which use a limited number of CPU registers to store a large number of program variables, may introduce side-channel leaks even in software equipped with state-of-the-art countermeasures. We propose a program analysis and transformation based method to eliminate such leaks. Our method has a type-based technique for detecting leaks, which leverages Datalog-based declarative analysis and domain-specific optimizations to achieve high efficiency and accuracy. It also has a mitigation technique for the compiler's backend, more specifically the register allocation modules, to ensure that leaky intermediate computation results are stored in different CPU registers or memory locations. We have implemented and evaluated our method in LLVM for the x86 instruction set architecture. Our experiments on cryptographic software show that the method is effective in removing the side channel while being efficient, i.e., our mitigated code is more compact and runs faster than code mitigated using state-of-the-art techniques.
DOI 原文 ·
@inproceedings{paperbot5100,
title = {Mitigating power side channels during compilation},
author = {Jingbo Wang and Chungha Sung and Chao Wang},
booktitle = {FSE},
year = {2019},
doi = {10.1145/3338906.3338913}
}