MESH:一个适用于C/C ++的高效内存安全堆
MESH: A Memory-Efficient Safe Heap for C/C++
摘要:
虽然使用不安全的程序设计语言引起的内存损坏错误是一个古老且经过充分研究的问题,但由此产生的漏洞仍然主导着当今的现实世界。已经提出了各种缓解措施来缓解这个问题,主要是以语言方言、静态程序分析和代码或二进制插装的形式。像AdressSanitizer(ASan)和Softbound/CETS这样的解决方案已经证明,后一种方法非常有前途,能够在不需要手动源代码适配的情况下实现内存安全,尽管会带来大量的性能和内存开销。虽然性能开销可以被看作是灵活的约束,但是对于在存储器受限的环境中使用这样的解决方案,大量的存储器开销可能是禁止的。为了解决这个问题,我们提出了MESH,一个高内存效率的C/C++安全堆。凭借其恒定的、非常小的内存开销(在x86-64上可配置高达2 MB)和指针访问检查的恒定复杂性,MESH为内存受限的场景提供了高效的、字节精确的空间和时间内存安全性。在不危及安全堆对象的安全性的情况下,MESH与现有代码和未插装的库完全兼容,使其在异构环境中使用变得实用。我们展示了我们的方法的可行性与一个完整的基于LLVM的原型支持两个主要架构,即,x86-64和ARM 64,在Linux运行时环境中。我们的原型评估表明,相比ASan和Softbound/CETS,MESH可以实现巨大的内存节省,同时保持类似的执行性能。
英文摘要:
While memory corruption bugs stemming from the use of unsafe programming languages are an old and well-researched problem, the resulting vulnerabilities still dominate real-world exploitation today. Various mitigations have been proposed to alleviate the problem, mainly in the form of language dialects, static program analysis, and code or binary instrumentation. Solutions like AdressSanitizer (ASan) and Softbound/CETS have proven that the latter approach is very promising, being able to achieve memory safety without requiring manual source code adaptions, albeit suffering substantial performance and memory overheads. While performance overhead can be seen as a flexible constraint, extensive memory overheads can be prohibitive for the use of such solutions in memory-constrained environments. To address this problem, we propose MESH, a highly memory-efficient safe heap for C/C++. With its constant, very small memory overhead (configurable up to 2 MB on x86-64) and constant complexity for pointer access checking, MESH offers efficient, byte-precise spatial and temporal memory safety for memory-constrained scenarios. Without jeopardizing the security of safe heap objects, MESH is fully compatible with existing code and uninstrumented libraries, making it practical to use in heterogeneous environments. We show the feasibility of our approach with a full LLVM-based prototype supporting both major architectures, i.e., x86-64 and ARM64, in a Linux runtime environment. Our prototype evaluation shows that, compared to ASan and Softbound/CETS, MESH can achieve huge memory savings while preserving similar execution performance.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。