paperbot · PL 论文追踪

全部论文 待读 收藏

P2 CGuard: Scalable and Precise Object Bounds Protection for C

CGuard:面向 C 的可扩展且精确的对象边界保护
ISSTA Proceedings of the 32nd ACM SIGSOFT International Symposium on Software Testing and Analysis2023匹配度 1/10 · 该论文研究 C 语言运行时对象边界保护,属于系统安全与内存管理方向,与用户关注的静态分析、Agentic/LLM 程序分析、浮点或贝叶斯程序分析均无直接关联;仅在“程序分析/内存安全”这一宽泛 PL 系统主题上略有交集。引用 4 inbox
Piyus Kedia, Rahul Purandare, Udit Agarwal, Rishabh
crossref: 2026-09-12dblp: 2026-09-12

AI 速览

一句话:CGuard 在 x86_64 上实现精确对象边界保护,突破 SGXBounds 的 32 位地址空间限制且开销相当。

空间安全违规是许多安全攻击和应用异常行为的根源。现有空间安全保护技术分为对象粒度和指针粒度:对象粒度方案 CPU 开销高,指针粒度方案 CPU 和内存开销都高。SGXBounds 作为对象粒度方案,能以较低开销提供精确越界保护,但无法支持大于 32 位的地址空间。本文提出 CGuard,在不限制应用地址空间的前提下提供精确对象边界保护,开销与 SGXBounds 相当。CGuard 将边界信息存储在对象基地址之前,并利用 x86_64 虚拟地址中的空闲位编码基地址相对偏移;对于无法编码的大对象,采用定制内存布局,仅需一次内存访问即可找到基地址。评估在 SPEC CPU2017、Phoenix 和 Apache 上进行,发现了 gcc、x264 和 string_match 中的空间安全违规;SPEC CPU2017 与 Phoenix 的执行时间开销分别为 42% 和 26%,Apache 在 CPU 满载时吞吐下降 30%。

问题
空间安全违规会导致安全攻击和应用异常,现有对象粒度方案 CPU 开销高,指针粒度方案 CPU 与内存开销均高,而 SGXBounds 虽精确但无法支持超过 32 位的地址空间。
方法
CGuard 将对象边界信息存放在基地址之前,并利用 x86_64 虚拟地址空闲位编码基地址相对偏移;对无法编码的大对象采用定制内存布局,使基地址可通过一次内存访问找回。
评估
在 SPEC CPU2017、Phoenix 和 Apache 上评估,发现了 gcc、x264、string_match 中的空间安全违规,SPEC 与 Phoenix 执行时间开销分别为 42% 和 26%,Apache 满载吞吐下降 30%。
原文摘要(Abstract)

Spatial safety violations are the root cause of many security attacks and unexpected behavior of applications. Existing techniques to enforce spatial safety work broadly at either object or pointer granularity. Object-based approaches tend to incur high CPU overheads, whereas pointer-based approaches incur both high CPU and memory overheads. SGXBounds, an object-based approach, provides precise out-of-bounds protection for objects at a lower overhead compared to other tools with similar precision. However, a major drawback of this approach is that it cannot support address space larger than 32-bit. In this paper, we present CGuard, a tool that provides precise object-bounds protection for C applications with comparable overheads to SGXBounds without restricting the application address space. CGuard stores the bounds information just before the base address of an object and encodes the relative offset of the base address in the spare bits of the virtual address available in x86_64 architecture. For an object that cannot fit in the spare bits, CGuard uses a custom memory layout that enables it to find the base address of the object in just one memory access. Our study revealed spatial safety violations in the gcc and x264 benchmarks from the SPEC CPU2017 benchmark suite and the string_match benchmark from the Phoenix benchmark suite. The execution time overheads for the SPEC CPU2017 and Phoenix benchmark suites were 42% and 26% respectively, whereas the reduction in the throughput for the Apache webserver when the CPUs were fully saturated was 30%. These results indicate that CGuard can be highly effective while maintaining a reasonable degree of efficiency.

链接与引用

DOI 原文 · PDF(开放获取) · DBLP

BibTeX
@inproceedings{KediaPAR23,
  title = {CGuard: Scalable and Precise Object Bounds Protection for C},
  author = {Piyus Kedia and Rahul Purandare and Udit Agarwal and Rishabh},
  booktitle = {ISSTA},
  year = {2023},
  doi = {10.1145/3597926.3598137}
}