GWP-ASan:基于采样的生产环境内存安全缺陷检测
GWP-ASan: Sampling-Based Detection of Memory-Safety Bugs in Production
AI总结:
本文提出 GWP-ASan 工具族,通过页粒度受保护分配与低速率采样相结合,在生产环境中以近零开销检测堆释放后使用和堆缓冲区溢出缺陷,并在多平台多年部署中验证了其有效性。
摘要:
尽管预生产阶段的缺陷检测近期有所进展,但在所有主要软件生态系统中,对于使用 C 或 C++ 编写的应用程序而言,堆释放后使用(heap-use-after-free)和堆缓冲区溢出(heap-buffer-overflow)缺陷仍然是安全、可靠性和开发者生产力方面的首要问题。内存安全语言在使用时可以解决这一问题,但现有由数十亿行 C 和 C++ 代码组成的代码库仍在持续增长,因此我们需要额外的缺陷检测机制。本文描述了一组在生产环境中以接近零开销运行、用于检测这两类内存安全缺陷的工具。这些工具结合了页粒度受保护分配(page-granular guarded allocation)和低速率采样。换句话说,我们为一个已有 36 年历史的思路添加了一个“if”语句,并使其能够在大规模场景下工作。我们描述了基本算法、其若干变体与实现,以及在移动、桌面和服务器应用上多年部署的结果。
英文摘要:
Despite the recent advances in pre-production bug detection, heap-use-after-free and heap-buffer-overflow bugs remain the primary problem for security, reliability, and developer productivity for applications written in C or C++, across all major software ecosystems. Memory-safe languages solve this problem when they are used, but the existing code bases consisting of billions of lines of C and C++ continue to grow, and we need additional bug detection mechanisms. This paper describes a family of tools that detect these two classes of memory-safety bugs, while running in production, at near-zero overhead. These tools combine page-granular guarded allocation and low-rate sampling. In other words, we added an "if" statement to a 36-year-old idea and made it work at scale. We describe the basic algorithm, several of its variants and implementations, and the results of multi-year deployments across mobile, desktop, and server applications.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。