Temporal memory safety bugs, especially use-after-free and double free bugs, pose a major security threat to C programs. Real-world exploits utilizing these bugs enable attackers to read and write arbitrary memory locations, causing disastrous violations of confidentiality, integrity, and availability. Many previous solutions retrofit temporal memory safety to C, but they all either incur high performance overhead and/or miss detecting certain types of temporal memory safety bugs.
In this paper, we propose a temporal memory safety solution that is both efficient and comprehensive. Specifically, we extend Checked C, a spatially-safe extension to C, with temporally-safe pointers. These are implemented by combining two techniques: fat pointers and dynamic key-lock checks. We show that the fat-pointer solution significantly improves running time and memory overhead compared to the disjoint-metadata approach that provides the same level of protection. With empirical program data and hands-on experience porting real-world applications, we also show that our solution is practical in terms of backward compatibility -- one of the major complaints about fat pointers.
PTAuth: Temporal Memory Safety via Robust Points-to Authentication
临时内存损坏是经常被利用的软件漏洞,可导致强大的攻击。尽管几十年来对缓解技术的研究取得了重大进展,但现有的对策由于覆盖范围有限或开销过高而不足。此外,它们需要外部机制(例如,空间存储安全)以保护其元数据。否则,它们的保护可能被绕过或禁用。为了解决这些局限性,我们提出了强大的点到认证,一种新的运行时检测各种临时内存损坏的计划。我们建立了一个原型系统,称为PTAuth,在ARM架构上实现了这个方案。PTAuth包含用于代码分析和插装的自定义编译器,以及用于在受保护程序运行时执行指向身份验证的运行时库。PTAuth利用ARMv8.3及更高版本CPU提供的指针验证码(PAC)功能,该功能可用作简单的基于硬件的加密原语。PTAuth使用最少的内存元数据,并在不需要空间内存安全的情况下保护其元数据。我们报告我们的评估PTAuth的安全性,鲁棒性和性能使用150个脆弱的程序从朱丽叶测试套件和SPEC CPU 2006基准。PTAuth检测所有三类基于堆的临时内存损坏,生成零错误警报,并将程序执行速度降低26%(该数字是基于软件模拟的PAC测量的;当使用基于硬件的PAC时,预计将降低到20%)。我们还表明,由于元数据的有效使用,PTAuth会产生2%的内存开销。
A Comprehensive and Cross-Platform Test Suite for Memory Safety -- Towards an Open Framework for Testing Processor Hardware Supported Security Extensions
PICASSO: Scaling CHERI Use-After-Free Protection to Millions of Allocations using Colored Capabilities
Ericsson Security Research(爱立信安全研究);DistriNet, KU Leuven(鲁汶大学 DistriNet 研究中心);University of Waterloo(滑铁卢大学);University of Cambridge(剑桥大学);KTH Royal Institute of Technology(瑞典皇家理工学院);Ericsson Product Security(爱立信产品安全)