Lune

ASPLOS2023顶会

Finding Unstable Code via Compiler-Driven Differential Testing

Shaohua Li, Zhendong Su

摘要

Unstable code refers to code that has inconsistent or unstable runtime semantics due to undefined behavior (UB) in the program. Compilers exploit UB by assuming that UB never occurs, which allows them to generate efficient but potentially semantically inconsistent binaries. Practitioners have put great research and engineering effort into designing dynamic tools such as sanitizers for frequently occurring UBs. However, it remains a big challenge how to detect UBs that are beyond the reach of current techniques.

In this paper, we introduce compiler-driven differential testing (CompDiff), a simple yet effective approach for finding unstable code in C/C++ programs. CompDiff relies on the fact that when compiling unstable code, different compiler implementations may produce semantically inconsistent binaries. Our main approach is to examine the outputs of different binaries on the same input. Discrepancies in outputs may signify the existence of unstable code. To detect unstable code in real-world programs, we also integrate Com-pDiff into AFL++, the most widely-used and actively-maintained general-purpose fuzzer.

Despite its simplicity, CompDiff is effective in practice: on the Juliet benchmark programs, CompDiff uniquely detected 1,409 bugs compared to sanitizers; on 23 popular open-source C/C++ projects, CompDiff-AFL++ uncovered 78 new bugs, 52 of which have been fixed by developers and 36 cannot be detected by sanitizers. Our evaluation also reveals the fact that CompDiff is not designed to replace current UB detectors but to complement them.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 10 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • Exploring Missed Optimizations in WebAssembly Optimizers 引用了 RetroWrite: Statically Instrumenting COTS Binaries for Fuzzing and Sanitization
  • NEZHA: Efficient Domain-Independent Differential Testing 引用了 Driller: Augmenting Fuzzing Through Selective Symbolic Execution
  • NEZHA: Efficient Domain-Independent Differential Testing 引用了 Coverage-based Greybox Fuzzing as Markov Chain
  • REDQUEEN: Fuzzing with Input-to-State Correspondence 引用了 Driller: Augmenting Fuzzing Through Selective Symbolic Execution
  • REDQUEEN: Fuzzing with Input-to-State Correspondence 引用了 Coverage-based Greybox Fuzzing as Markov Chain
  • RetroWrite: Statically Instrumenting COTS Binaries for Fuzzing and Sanitization 引用了 Coverage-based Greybox Fuzzing as Markov Chain
  • WBSan: WebAssembly Bug Detection for Sanitization and Binary-Only Fuzzing 引用了 RetroWrite: Statically Instrumenting COTS Binaries for Fuzzing and Sanitization
  • Coverage-based Greybox Fuzzing as Markov Chain 引用了 Driller: Augmenting Fuzzing Through Selective Symbolic Execution
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper10

  1. Exploring Missed Optimizations in WebAssembly OptimizersZhibo Liu, Dongwei Xiao, Zongjie Li, Shuai Wang 等ISSTA 2023 · 24 次引用
  2. UBFuzz: Finding Bugs in Sanitizer ImplementationsShaohua Li, Zhendong SuASPLOS 2024 · 8 次引用
  3. Rust-twins: Automatic Rust Compiler Testing through Program Mutation and Dual Macros GenerationWenzhang Yang, Cuifeng Gao, Xiaoyuan Liu, Yuekang Li 等ASE 2024 · 5 次引用
  4. WBSan: WebAssembly Bug Detection for Sanitization and Binary-Only FuzzingXiao Wu, Junzhou He, Liyan Huang, Cai Fu 等WWW 2025 · 5 次引用
  5. SIRO: Empowering Version Compatibility in Intermediate Representations via Program SynthesisBowen Zhang, Wei Chen, Peisen Yao, Chengpeng Wang 等ASPLOS 2024 · 4 次引用

它引用的 Paper14

  1. Coverage-based Greybox Fuzzing as Markov ChainMarcel Böhme, Van-Thuan Pham, Abhik RoychoudhuryCCS 2016 · 1,026 次引用
  2. Driller: Augmenting Fuzzing Through Selective Symbolic ExecutionNick Stephens, John Grosen, Christopher Salls, Andrew Dutcher 等NDSS 2016 · 1,021 次引用
  3. REDQUEEN: Fuzzing with Input-to-State CorrespondenceCornelius Aschermann, Sergej Schumilo, Tim Blazytko, Robert Gawlik 等NDSS 2019 · 413 次引用
  4. RetroWrite: Statically Instrumenting COTS Binaries for Fuzzing and SanitizationSushant Dinesh, Nathan Burow, Dongyan Xu, Mathias PayerS&P 2020 · 187 次引用
  5. NEZHA: Efficient Domain-Independent Differential TestingTheofilos Petsios, Adrian Tang, Salvatore J. Stolfo, Angelos D. Keromytis 等S&P 2017 · 132 次引用

相关 Paper

  1. Don't Look UB: Exposing Sanitizer-Eliding Compiler OptimizationsRaphael Isemann, Cristiano Giuffrida, Herbert Bos, Erik van der Kouwe 等PLDI 2023 · 5 次引用
  2. Enriching Compiler Testing with Real Program from Bug ReportHao ZhongASE 2022 · 24 次引用
  3. CombiSan: Unifying Software Sanitizers for Comprehensive FuzzingMatteo Marini, Floris Gorter, Daniele Cono D'Elia, Cristiano GiuffridaUSENIX Security 2026
  4. Sand: Decoupling Sanitization from Fuzzing for Low OverheadZiqiao Kong, Shaohua Li, Heqing Huang, Zhendong SuICSE 2025 · 1 次引用
  5. ZendDiff: Differential Testing of PHP InterpreterYuancheng Jiang, Jianing Wang, Qiange Liu, Yeqi Fu 等ASE 2025 · 1 次引用
黄昏的海面,两侧是细线勾勒的悬崖