Fault attacks enable adversaries to manipulate the control-flow of security-critical applications. By inducing targeted faults into the CPU, the software's call graph can be escaped and the control-flow can be redirected to arbitrary functions inside the program. To protect the control-flow from these attacks, dedicated fault control-flow integrity (CFI) countermeasures are commonly deployed. However, these schemes either have high detection latencies or require intrusive hardware changes. In this paper, we present EC-CFI, a software-based cryptographically enforced CFI scheme with no detection latency utilizing hardware features of recent Intel platforms. Our EC-CFI prototype is designed to prevent an adversary from escaping the program's call graph using faults by encrypting each function with a different key before execution. At runtime, the instrumented program dynamically derives the decryption key, ensuring that the code only can be successfully decrypted when the program follows the intended call graph. To enable this level of protection on Intel commodity systems, we introduce extended page table (EPT) aliasing allowing us to achieve function-granular encryption by combing Intel's TME-MK and virtualization technology. We open-source our custom LLVM-based toolchain automatically protecting arbitrary programs with EC-CFI. Furthermore, we evaluate our EPT aliasing approach with the SPEC CPU2017 and Embench-IoT benchmarks and discuss and evaluate potential TME-MK hardware changes minimizing runtime overheads.
翻译:故障攻击使得攻击者可以操纵安全关键应用程序的控制流。通过在CPU中诱发特定的故障,软件的调用图可以被逃脱,控制流可以重定向到程序内的任意函数。为了保护控制流免受这些攻击的影响,常常会部署专用的故障控制流完整性(CFI)对策。但是,这些方案要么具有较高的检测延迟,要么需要侵入性的硬件更改。在本文中,我们提出了EC-CFI,一种使用最近Intel平台的硬件特性进行软件基础的加密强制CFI方案,无检测延迟。我们的EC-CFI原型旨在通过在执行之前使用不同密钥对每个函数进行加密来防止对手通过故障逃逸程序的调用图。在运行时,仪器化程序动态派生解密密钥,确保仅当程序按照预期的调用图进行时才能成功解密代码。为了在Intel普通系统上实现此级别的保护,我们引入了扩展页表(EPT)别名,通过Intel的TME-MK和虚拟化技术实现基于函数的加密。我们开源我们基于LLVM的自定义工具链,自动保护任意程序与EC-CFI。此外,我们使用SPEC CPU2017和Embench-IoT基准评估了我们的EPT别名方法,并讨论和评估了最小化运行时开销的潜在TME-MK硬件更改。