paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Don’t Look UB: Exposing Sanitizer-Eliding Compiler Optimizations

Don’t Look UB:揭示消除 Sanitizer 失败的编译器优化
PLDI 7(PLDI)2023匹配度 3/10 · 论文属于编译器优化与 sanitizer 的差分测试/静态分析 bug 发现,与用户核心关注的 LLM/Agent 和静态分析交叉、浮点程序分析、贝叶斯程序分析无直接关系;仅在“静态分析/程序分析用于 bug 发现”上有边缘交集。引用 5 inbox
Raphael Isemann, Cristiano Giuffrida, Herbert Bos, Erik van der Kouwe, Klaus von Gleissenthall
crossref: 2026-09-10

AI 速览

一句话:提出差分测试框架 LookUB,发现 Clang 中 17 个消除 sanitizer 失败的优化,并挖出 20 个新 bug。

Sanitizer 通过运行时检查检测未定义行为及其漏洞,但常与优化 pass 同用,二者目标冲突:优化器会利用 UB 假设提升性能,可能删除 sanitizer 的失败报告,从而隐藏甚至引入缺陷。本文提出 LookUB,一个基于差分测试的框架,用于系统发现会消除 sanitizer 失败的优化器变换。作者用该方法在 Clang 中找到 17 个此类优化,并结合静态分析与 fuzzing 搜索此前被这些优化掩盖的 bug,在 Linux Containers、libmpeg2、NTFS-3G 和 WINE 中发现 20 个新 bug。最后提出定制 Clang 优化器的缓解策略,仅带来 4% 开销。

问题
Sanitizer 与编译器优化目标冲突:优化器可能删除 sanitizer 检查或失败报告,导致未定义行为缺陷被隐藏甚至被引入。
方法
提出基于差分测试的框架 LookUB,系统寻找会消除 sanitizer 失败的优化器变换;再结合静态分析与 fuzzing 搜索被这些优化掩盖的真实项目 bug。
评估
在 Clang 中发现 17 个消除 sanitizer 失败的优化,并在 Linux Containers、libmpeg2、NTFS-3G、WINE 中确认 20 个新 bug;提出的定制优化器缓解策略仅增加 4% 开销。
原文摘要(Abstract)

Sanitizers are widely used compiler features that detect undefined behavior and resulting vulnerabilities by injecting runtime checks into programs. For better performance, sanitizers are often used in conjunction with optimization passes. But doing so combines two compiler features with conflicting objectives. While sanitizers want to expose undefined behavior, optimizers often exploit these same properties for performance. In this paper, we show that this clash can have serious consequences: optimizations can remove sanitizer failures, thereby hiding the presence of bugs or even introducing new ones. We present LookUB, a differential-testing based framework for finding optimizer transformations that elide sanitizer failures. We used our method to find 17 such sanitizer-eliding optimizations in Clang. Next, we used static analysis and fuzzing to search for bugs in open-source projects that were previously hidden due to sanitizer-eliding optimizations. This led us to discover 20 new bugs in Linux Containers, libmpeg2, NTFS-3G, and WINE. Finally, we present an effective mitigation strategy based on a customization of the Clang optimizer with an overhead increase of 4%.

链接与引用

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

BibTeX
@article{paperbot1974,
  title = {Don’t Look UB: Exposing Sanitizer-Eliding Compiler Optimizations},
  author = {Raphael Isemann and Cristiano Giuffrida and Herbert Bos and Erik van der Kouwe and Klaus von Gleissenthall},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {7},
  number = {PLDI},
  year = {2023},
  doi = {10.1145/3591257}
}