arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1912.10666cs.CRcs.OS
收藏

基于ARM指针认证的核前向和后向控制流完整性

ARM Pointer Authentication based Forward-Edge and Backward-Edge Control Flow Integrity for Kernels

Yutian Yang, Songbo Zhu, Wenbo Shen, Yajin Zhou, Jiadong Sun, Kui Ren

摘要:

代码重用攻击仍然是软件和系统安全的一大威胁。控制流完整性是一种很有前途的技术,以防止这种攻击。然而,由于不准确的控制流图和以安全换取性能的实用策略,其有效性已被削弱。近年来,CPU供应商已经集成了硬件功能作为对策。例如,在ARMV 8-A架构中引入了ARM指针认证(简称PA)。它可以有效地为地址生成认证码,该认证码编码在地址的未使用位中。取消引用地址时,将检查身份验证代码以确保其完整性。虽然已有系统采用PA来加固用户程序,但如何有效地使用PA来保护操作系统内核仍然是一个开放的研究问题。在本文中,我们阐明了如何利用PA保护控制流,包括函数指针和返回地址,Linux内核。具体来说,为了保护函数指针,我们将身份验证代码嵌入其中,跟踪它们的传播,并在从内存加载或分支到目标时验证它们的值。为了进一步防御指针替换攻击,我们使用函数指针地址作为其上下文,并采取一种干净的设计,通过将其捎带到指针值中来传播地址。我们已经实现了一个原型系统与LLVM识别函数指针,添加认证代码和验证函数指针发出新的机器指令。我们将该系统应用到Linux内核中,解决了许多实际问题,例如,函数指针比较和算术运算。安全性分析表明,该系统能够保护Linux内核中所有的函数指针和返回地址。

英文摘要:

Code reuse attacks are still big threats to software and system security. Control flow integrity is a promising technique to defend against such attacks. However, its effectiveness has been weakened due to the inaccurate control flow graph and practical strategy to trade security for performance. In recent years, CPU vendors have integrated hardware features as countermeasures. For instance, ARM Pointer Authentication (PA in short) was introduced in ARMV8-A architecture. It can efficiently generate an authentication code for an address, which is encoded in the unused bits of the address. When the address is de-referenced, the authentication code is checked to ensure its integrity. Though there exist systems that adopt PA to harden user programs, how to effectively use PA to protect OS kernels is still an open research question. In this paper, we shed lights on how to leverage PA to protect control flows, including function pointers and return addresses, of Linux kernel. Specifically, to protect function pointers, we embed authentication code into them, track their propagation and verify their values when loading from memory or branching to targets. To further defend against the pointer substitution attack, we use the function pointer address as its context, and take a clean design to propagate the address by piggybacking it into the pointer value. We have implemented a prototype system with LLVM to identify function pointers, add authentication code and verify function pointers by emitting new machine instructions. We applied this system to Linux kernel, and solved numerous practical issues, e.g., function pointer comparison and arithmetic operations. The security analysis shows that our system can protect all function pointers and return addresses in Linux kernel.

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

↑