In the era of microarchitectural side channels, vendors scramble to deploy mitigations for transient execution attacks, but leave traditional side-channel attacks against sensitive software (e.g., crypto programs) to be fixed by developers by means of constant-time programming (i.e., absence of secret-dependent code/data patterns). Unfortunately, writing constant-time code by hand is hard, as evidenced by the many flaws discovered in production side channel-resistant code. Prior efforts to automatically transform programs into constant-time equivalents offer limited security or compatibility guarantees, hindering their applicability to real-world software. In this paper, we present Constantine, a compiler-based system to automatically harden programs against microarchitectural side channels. Constantine pursues a radical design point where secret-dependent control and data flows are completely linearized (i.e., all involved code/data accesses are always executed). This strategy provides strong security and compatibility guarantees by construction, but its natural implementation leads to state explosion in real-world programs. To address this challenge, Constantine relies on carefully designed optimizations such as just-in-time loop linearization and aggressive function cloning for fully context-sensitive points-to analysis, which not only address state explosion, but also lead to an efficient and compatible solution. Constantine yields overheads as low as 16% on standard benchmarks and can handle a fully-fledged component from the production wolfSSL library.
翻译:在微观建筑侧渠道的时代,供应商争相为短暂的执行攻击部署缓解措施,但让开发者通过固定时间编程(即没有秘密依赖的代码/数据模式)固定对敏感软件(例如加密程序)的传统侧通道攻击(例如加密程序),由开发者通过固定时间编程(即没有秘密依赖的代码/数据模式)加以固定。不幸的是,手工写固定时间代码很困难,这体现在生产侧通道防盗代码中发现的许多缺陷。在努力将程序自动转换为固定时间等同程序之前,安全或兼容性保障有限,妨碍其对现实世界软件的适用。在本文件中,我们介绍君士坦丁,一个基于编译器的系统,用来自动硬化程序,对抗微观建筑侧通道。康斯坦丁追求一个激进的设计点,在这个点上,秘密依赖秘密控制和数据流动(即所有涉及代码/数据的存取权都得到实施),这个战略通过施工提供强有力的安全和兼容性保障,但其自然实施导致现实世界方案中的状态爆炸。为了应对这一挑战,康斯坦丁依靠精心设计的优化,例如仅仅在时间环绕线形线性循环和侵略性功能上,从16个标准的直径直径直基克隆标准,而可以进行完全的直达的直达的直达的基克隆分析。