Memory Protection Keys for Userspace (PKU) is a recent hardware feature that allows programs to assign virtual memory pages to protection domains, and to change domain access permissions using inexpensive, unprivileged instructions. Several in-process memory isolation approaches leverage this feature to prevent untrusted code from accessing sensitive program state and data. Typically, PKU-based isolation schemes need to be used in conjunction with mitigations such as CFI because untrusted code, when compromised, can otherwise bypass the PKU access permissions using unprivileged instructions or operating system APIs. Recently, researchers proposed fully self-contained PKUbased memory isolation schemes that do not rely on other mitigations. These systems use exploit-proof call gates to transfer control between trusted and untrusted code, as well as a sandbox that prevents tampering with the PKU infrastructure from untrusted code. In this paper, we show that these solutions are not complete. We first develop two proof-of-concept attacks against a state-of-the-art PKU-based memory isolation scheme. We then present Garmr, a PKU-based sandboxing framework that can overcome limitations of existing sandboxes. We apply Garmr to several memory isolation schemes and show that it is practical, efficient and secure.
翻译:用户空间的内存保护密钥( PKU) 是最近的一个硬件特征,使程序能够将虚拟记忆页面分配给保护领域,并使用廉价、无特权的指示改变域域访问许可。 几个程序内内内内隔离方法利用这一特性防止不受信任的代码访问敏感程序状态和数据。 通常, 以PKU为基础的孤立计划需要与CFI 等缓解方案一起使用, 因为不受信任的代码一旦被破坏, 可能绕过PKU访问许可, 使用未经特许的指示或操作系统APIs。 最近, 研究人员提出了完全自成一体的PKU内存隔离计划, 不依赖其他减缓措施。 这些系统使用防开发的调用门在信任和不受信任的代码之间转移控制, 以及一个沙箱, 防止对 PKU 基础设施的篡改不受信任的代码。 在本文中, 我们显示这些解决方案不完整。 我们首先开发了两种对基于艺术的 PKU 记忆隔离状态的校准攻击。 我们随后向 Garmr 展示了一套基于安全的软体的软体的软体系统, 展示了有效的沙箱 。