Skip to main content
QUICK REVIEW

[论文解读] Efficient Sealable Protection Keys for RISC-V

Leila Delshadtehrani, Sadullah Canakci|arXiv (Cornell University)|Dec 4, 2020
Security and Verification in Computing参考文献 16被引用 4
一句话总结

该论文提出 SealPK,一种针对 RISC-V 的高效进程内内存隔离机制,通过利用 Sv-39 页表项中 10 个未使用的位,支持最多 1024 个保护域。该机制通过操作系统级别的延迟释放机制防止 pkey 使用后释放漏洞,并引入三种新颖的密封功能,以防止对域权限、页和密钥的篡改,通过 FPGA 原型验证,性能开销极低,并成功实现了影子栈隔离。

ABSTRACT

With the continuous increase in the number of software-based attacks, there has been a growing effort towards isolating sensitive data and trusted software components from untrusted third-party components. A hardware-assisted intra-process isolation mechanism enables software developers to partition a process into isolated components and in turn secure sensitive data from untrusted components. However, most of the existing hardware-assisted intra-process isolation mechanisms in modern processors, such as ARM and IBM Power, rely on costly kernel operations for switching between trusted and untrusted domains. Recently, Intel introduced a new hardware feature for intra-process memory isolation, called Memory Protection Keys (MPK), which enables a user-space process to switch the domains in an efficient way. While the efficiency of Intel MPK enables developers to leverage it for common use cases such as Code-Pointer Integrity, the limited number of unique domains (16) prohibits its use in cases such as OpenSSL where a large number of domains are required. Moreover, Intel MPK suffers from the protection key use-after-free vulnerability. To address these shortcomings, in this paper, we propose an efficient intra-process isolation technique for the RISC-V open ISA, called SealPK, which supports up to 1024 unique domains. SealPK prevents the protection key use-after-free problem by leveraging a lazy de-allocation approach. To further strengthen SealPK, we devise three novel sealing features to protect the allocated domains, their associated pages, and their permissions from modifications or tampering by an attacker. To demonstrate the feasibility of our design, we implement SealPK on a RISC-V Rocket processor, provide the OS support for it, and prototype our design on an FPGA. We demonstrate the efficiency of SealPK by leveraging it to implement an isolated shadow stack on our FPGA prototype.

研究动机与目标

  • 通过在 RISC-V 上支持最多 1024 个域,解决 Intel MPK 仅支持 16 个保护键的可扩展性受限问题。
  • 通过引入操作系统级别的延迟释放机制,消除 Intel MPK 中固有的 pkey 使用后释放漏洞,该机制通过跟踪域引用计数来实现。
  • 通过三种新颖的密封功能,防止攻击者对保护域、其页和权限位进行未经授权的修改。
  • 通过在 RISC-V Rocket 核心 FPGA 原型上实现 SealPK 并提供完整操作系统支持,证明其可行性和高效性。
  • 为真实工作负载(如 OpenSSL 和影子栈保护)提供安全、高性能的进程内隔离。

提出的方法

  • 利用 Sv-39 页表项(PTE)中 10 个未使用的位来编码保护键,实现 2^10 = 1024 个唯一域。
  • 在操作系统级别实现一种延迟释放机制,将保护键的失效延迟到所有相关页都被释放后才执行。
  • 设计一个专用的 2KB 私有密钥寄存器(PKR),用于存储保护键权限,并与页表查找在同一周期内访问。
  • 设计三种密封功能:(1) 域密封,用于保护域完整性;(2) 页密封,用于防止未经授权的页修改;(3) 权限密封,用于将 WRPKRU 指令的访问限制为每个密钥仅一个受信任内存区域。
  • 使用自定义 RoCC 指令与 PKR 接口,实现在运行时强制执行密封策略。
  • 将 SealPK 集成到 RISC-V Rocket 核心,扩展操作系统以支持域管理和引用计数,并在 FPGA 上构建系统原型。

实验结果

研究问题

  • RQ1能否在开放的 RISC-V ISA 上构建一种可扩展、安全的进程内内存隔离机制,支持超过 16 个域?
  • RQ2如何在不依赖内核级强制或复杂二进制插桩的情况下,消除 pkey 使用后释放漏洞?
  • RQ3硬件强制的域、页和权限密封在多大程度上能防止恶意组件的篡改?
  • RQ4将此类机制集成到 RISC-V 处理器核心时,其性能和面积开销如何?
  • RQ5SealPK 是否能在实际中有效保护关键安全原原子(如影子栈)?

主要发现

  • SealPK 通过利用 Sv-39 PTE 中的 10 个未使用位,支持最多 1024 个唯一保护域,显著超过 Intel MPK 的 16 域限制。
  • 操作系统级别的延迟释放机制通过在所有页被释放后才失效保护键,有效防止了 pkey 使用后释放漏洞。
  • FPGA 原型显示,LUT 和 FF 的面积开销分别仅为 5.62% 和 2.72%,功耗开销估计低于 5%,表明硬件成本极低。
  • SealPK 引入了三种新颖的密封功能,可防止运行时对域完整性、页内容和权限位的篡改。
  • 原型在 SPEC2000、SPEC2006 和 MiBench 工作负载上的平均性能开销分别为 21.00%、14.81% 和 8.52%,证明了其实际效率。
  • SealPK 在 FPGA 原型上成功实现了隔离的影子栈,验证了其在实际中保护控制流完整性的适用性。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。