论文标题
功能强大:使用指针 - 适当的原则安全地编译部分程序
CapablePtrs: Securely Compiling Partial Programs Using the Pointers-as-Capabilities Principle
论文作者
论文摘要
Cheri之类的功能机器提供了记忆功能,可以由编译器使用这些功能来为编译代码(例如,内存安全)提供安全益处。例如,现有的C到Cheri编译器,通过遵循称为“指针为功能”(PAC)的原则来实现记忆安全。在非正式的情况下,PAC说编译器应代表源语言指针作为机器代码功能。但是PAC编译器的安全性尚未得到充分了解。我们表明,内存安全性只是一个方面,PAC编译器可以为部分程序提供明显的额外安全保证:编译器可以为编译单元提供安全保证,即使该编译单元后来链接到攻击者提供的机器代码。 因此,本文是第一个研究PAC编译器对部分程序的安全性。我们证明了这样一个编译器的模型,它是完全抽象的。该证明使用一种新颖的证明技术(称为Tricl,阅读trick滴),这应该引起广泛的兴趣,因为它可以重复整个程序编译器的正确性关系以进行全面抽象,从而节省了工作。我们还在Cheri上实施了C的C方案,这表明我们可以以最小的更改编译旧版C代码,并表明编译代码的性能开销与交叉补偿单位功能调用的数量大致成正比。
Capability machines such as CHERI provide memory capabilities that can be used by compilers to provide security benefits for compiled code (e.g., memory safety). The existing C to CHERI compiler, for example, achieves memory safety by following a principle called "pointers as capabilities" (PAC). Informally, PAC says that a compiler should represent a source language pointer as a machine code capability. But the security properties of PAC compilers are not yet well understood. We show that memory safety is only one aspect, and that PAC compilers can provide significant additional security guarantees for partial programs: the compiler can provide security guarantees for a compilation unit, even if that compilation unit is later linked to attacker-provided machine code. As such, this paper is the first to study the security of PAC compilers for partial programs formally. We prove for a model of such a compiler that it is fully abstract. The proof uses a novel proof technique (dubbed TrICL, read trickle), which should be of broad interest because it reuses the whole-program compiler correctness relation for full abstraction, thus saving work. We also implement our scheme for C on CHERI, show that we can compile legacy C code with minimal changes, and show that the performance overhead of compiled code is roughly proportional to the number of cross-compilation-unit function calls.