Lune

OOPSLA2021顶会

Not so fast: understanding and mitigating negative impacts of compiler optimizations on code reuse gadget sets

Michael D. Brown, Matthew Pruett, Robert Bigelow, Girish Mururu, Santosh Pande

摘要

Despite extensive testing and correctness certification of their functional semantics, a number of compiler optimizations have been shown to violate security guarantees implemented in source code. While prior work has shed light on how such optimizations may introduce semantic security weaknesses into programs, there remains a significant knowledge gap concerning the impacts of compiler optimizations on non-semantic properties with security implications. In particular, little is currently known about how code generation and optimization decisions made by the compiler affect the availability and utility of reusable code segments called gadgets required for implementing code reuse attack methods such as return-oriented programming.

In this paper, we bridge this gap through a study of the impacts of compiler optimization on code reuse gadget sets. We analyze and compare 1,187 variants of 20 different benchmark programs built with two production compilers (GCC and Clang) to determine how their optimization behaviors affect the code reuse gadget sets present in program variants with respect to both quantitative and qualitative metrics. Our study exposes an important and unexpected problem; compiler optimizations introduce new gadgets at a high rate and produce code containing gadget sets that are generally more useful to an attacker than those in unoptimized code. Using differential binary analysis, we identify several undesirable behaviors at the root of this phenomenon. In turn, we propose and evaluate several strategies to mitigate these behaviors. In particular, we show that post-production binary recompilation can effectively mitigate these behaviors with negligible performance impacts, resulting in optimized code with significantly smaller and less useful gadget sets.

问 Lune

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

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

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

可以从这些问题问起

Lune 可以查阅

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

获取答案

免费开始,无需绑卡

脉络

  • Automatic Recovery of Fine-grained Compiler Artifacts at the Binary Level 引用了 Dead Store Elimination (Still) Considered Harmful
  • Silent Bugs Matter: A Study of Compiler-Introduced Security Bugs 引用了 Dead Store Elimination (Still) Considered Harmful
  • Protecting Source Code Privacy When Hunting Memory Bugs 引用了 Improving Security Tasks Using Compiler Provenance Information Recovered At the Binary-Level
  • Improving Security Tasks Using Compiler Provenance Information Recovered At the Binary-Level 引用了 Automatic Recovery of Fine-grained Compiler Artifacts at the Binary Level
  • Improving Security Tasks Using Compiler Provenance Information Recovered At the Binary-Level 引用了 Dead Store Elimination (Still) Considered Harmful
  • Improving Security Tasks Using Compiler Provenance Information Recovered At the Binary-Level 引用了 Silent Bugs Matter: A Study of Compiler-Introduced Security Bugs
  • Improving Security Tasks Using Compiler Provenance Information Recovered At the Binary-Level 引用了 Egalito: Layout-Agnostic Binary Recompilation
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper4

  1. Improving Security Tasks Using Compiler Provenance Information Recovered At the Binary-LevelYufei Du, Omar Alrawi, Kevin Z. Snow, Manos Antonakakis 等CCS 2023 · 8 次引用
  2. Automatic Recovery of Fine-grained Compiler Artifacts at the Binary LevelYufei Du, Ryan Court, Kevin Z. Snow, Fabian MonroseUSENIX ATC 2022
  3. Silent Bugs Matter: A Study of Compiler-Introduced Security BugsJianhao Xu, Kangjie Lu, Zhengjie Du, Zhu Ding 等USENIX Security 2023
  4. Protecting Source Code Privacy When Hunting Memory BugsJielun Wu, Bing Shui, Hongcheng Fan, Shengxin Wu 等ASE 2025

它引用的 Paper5

  1. Debloating Software through Piece-Wise Compilation and LoadingAnh Quach, Aravind Prakash, Lok-Kwong YanUSENIX Security 2018 · 153 次引用
  2. The Dynamics of Innocent Flesh on the Bone: Code Reuse Ten Years LaterVictor van der Veen, Dennis Andriesse, Manolis Stamatogiannakis, Xi Chen 等CCS 2017 · 74 次引用
  3. Egalito: Layout-Agnostic Binary RecompilationDavid Williams-King, Hidenori Kobayashi, Kent Williams-King, Graham Patterson 等ASPLOS 2020 · 68 次引用
  4. Dead Store Elimination (Still) Considered HarmfulZhaomo Yang, Brian Johannesmeyer, Anders Trier Olesen, Sorin Lerner 等USENIX Security 2017 · 37 次引用
  5. BlankIt library debloating: getting what you want instead of cutting what you don'tChris Porter, Girish Mururu, Prithayan Barua, Santosh PandePLDI 2020 · 31 次引用

相关 Paper

  1. WarpAttack: Bypassing CFI through Compiler-Introduced Double-FetchesJianhao Xu, Luca Di Bartolomeo, Flavio Toffalini, Bing Mao 等S&P 2023
  2. Revisiting Optimization-Resilience Claims in Binary Diffing Tools: Insights from LLVM Peephole Optimization AnalysisXiaolei Ren, Mengfei Ren, Yu Lei, Jiang MingFSE 2025
  3. Methodologies for Quantifying (Re-)randomization Security and Timing under JIT-ROPSalman Ahmed, Ya Xiao, Kevin Z. Snow, Gang Tan 等CCS 2020 · 21 次引用
  4. Unleashing the hidden power of compiler optimization on binary code difference: an empirical studyXiaolei Ren, Michael Ho, Jiang Ming, Yu Lei 等PLDI 2021 · 57 次引用
  5. CLower: Detecting Compiler Pessimization Bugs through Redundant Memory AccessesJianhao Xu, Kunbo Zhang, Mathias Payer, Kangjie Lu 等OOPSLA 2026
黄昏的海面,两侧是细线勾勒的悬崖