paperbot · PL 论文追踪

全部论文 待读 收藏

P2 LeanBin: Harnessing Lifting and Recompilation to Debloat Binaries

LeanBin:利用提升与重编译对二进制进行去膨胀
ASE Proceedings of the 39th IEEE/ACM International Conference on Automated Software Engineering2024匹配度 2/10 · 该论文研究二进制去膨胀、提升与重编译,虽涉及静态/动态程序分析,但核心是传统编译与安全优化,并未涉及 LLM/Agent、浮点程序分析或贝叶斯程序分析,与用户当前关注的 PL 与 AI 交叉方向匹配度很低。引用 1 inbox
Igor Wodiany, Antoniu Pop, Mikel Luján
crossref: 2026-09-12

AI 速览

一句话:提出 LeanBin,结合动态执行轨迹与无启发式静态分析进行二进制提升和重编译,实现应用及共享库的去膨胀与特化。

为减少潜在攻击面,二进制去膨胀/特化工具会移除不必要代码。本文提出 LeanBin,结合动态执行轨迹与无启发式静态分析进行二进制提升和重编译。它先记录给定输入下必需的指令与控制流,再用静态分析扩展控制流以避免过度限制输入空间;然后结构化控制流,将二进制指令翻译为 C 子集并重新编译得到 LLVM IR 和精简二进制。该方法可同时处理应用与共享库,且不依赖静态提升器可能不健全的启发式,也避免了动态提升器执行时间过长的问题。在 SPEC CPU2006 INT 上,提升与去膨胀几何平均耗时为原生 1.78 倍,精简二进制运行开销 1.21 倍,gadget 降至 24.10%–30.22%,代码大小最低 53.59%;SQLite 案例运行最高快 1.24 倍,gadget 仅 3.65%。

问题
如何在不依赖可能不健全的静态提升启发式、也不承受动态提升长时间执行的前提下,对应用及共享库进行二进制去膨胀/特化,以减少攻击面。
方法
LeanBin 结合动态执行轨迹与无启发式静态分析,先记录并扩展所需控制流,再将二进制指令提升并翻译成 C 子集,借助现有编译器基础设施重编译为 LLVM IR 和精简二进制。
评估
在 SPEC CPU2006 INT 与 SQLite 案例上评估提升/去膨胀耗时、精简二进制的运行开销、gadget 比例和代码大小,并与原生执行或原始二进制比较。
原文摘要(Abstract)

To reduce the source of potential exploits, binary debloating or specialization tools are used to remove unnecessary code from binaries. This paper presents a new binary debloating and specialization tool, LeanBin, that harnesses lifting and recompilation, based on observed execution traces. The dynamically recorded execution traces capture the required subset of instructions and control flow of the application binary for a given set of inputs. This initial control flow is subsequently augmented using heuristic-free static analysis to avoid excessively restricting the input space. The further structuring of the control flow and translation of binary instructions into a subset of C enables a lightweight generation of the code that can be recompiled, obtaining LLVM IR and a new debloated binary. Unlike most debloating approaches, LeanBin enables both binary debloating of the application and shared libraries, while reusing the existing compiler infrastructure. Additionally, unlike existing binary lifters, it does not rely on potentially unsound heuristics used by static lifters, nor suffers from long execution times, a limitation of existing dynamic lifters. Instead, LeanBin combines both heuristic-free static and dynamic analysis. The run time of lifting and debloating SPEC CPU2006 INT benchmarks has a geomean of 1.78×, normalized to the native execution, and the debloated binary runs with a geomean overhead of 1.21×. The percentage of gadgets, compared to the original binary, has a geomean between 24.10% and 30.22%, depending on the debloating strategy; and the code size can be as low as 53.59%. For the SQLite use-case, LeanBin debloats a binary including its shared library and generates a debloated binary that runs up to 1.24× faster with 3.65% gadgets.

链接与引用

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

BibTeX
@inproceedings{paperbot8428,
  title = {LeanBin: Harnessing Lifting and Recompilation to Debloat Binaries},
  author = {Igor Wodiany and Antoniu Pop and Mikel Luján},
  booktitle = {ASE},
  year = {2024},
  doi = {10.1145/3691620.3695515}
}