Isolating sensitive state and data can increase the security and robustness of many applications. Examples include protecting cryptographic keys against exploits like OpenSSL's Heartbleed bug or protecting a language runtime from native libraries written in unsafe languages. When runtime references across isolation boundaries occur relatively infrequently, then conventional page-based hardware isolation can be used, because the cost of kernel- or hypervisor-mediated domain switching is tolerable. However, some applications, such as the isolation of cryptographic session keys in network-facing services, require very frequent domain switching. In such applications, the overhead of kernel- or hypervisor-mediated domain switching is prohibitive. In this paper, we present ERIM, a novel technique that provides hardware-enforced isolation with low overhead on x86 CPUs, even at high switching rates (ERIM's measured overhead is less than 1% for 100,000 switches per second). The key idea is to combine protection keys (MPKs), a feature recently added to x86 that allows protection domain switches in userspace, with binary inspection to prevent circumvention. We show that ERIM can be applied with little effort to new and existing applications, doesn't require compiler changes, can run on a stock Linux kernel, and has low runtime overhead even at high domain switching rates.
翻译:隔离敏感状态和数据可以提高许多应用程序的安全和稳健性。 例如保护加密密钥, 防止像 OpenSSL 的心脏错误, 或保护语言运行时间, 防止本地图书馆用不安全语言撰写的加密密钥。 当运行时, 相对不经常出现跨越隔离边界的情况时, 可以使用常规的基于页面的硬件隔离, 因为内核或超高视屏的网域切换成本是可以接受的。 但是, 一些应用程序, 如网络过滤服务中加密会话密钥的隔离, 需要非常频繁的域转接。 在这类应用程序中, 内核或超高视屏中域切换的域切换管理费用非常高。 在本文中, 我们展示了一种新技术, 使硬件强制隔离在 x86 CPU 上, 即使是在高切换率( ERIM 测得的间接费用每秒100,000 开关不到1% ) 。 关键的想法是将保护密钥( MPKs) 合并起来, 最近添加到 x86 的特性, 允许用户空间的保护域开关开关开关, 甚至用二手检查来防止绕开关。 我们展示ERIM 高端程序, 需要 快速转换现有高端的操作 。