研究编译器内联对机器学习二进制分析的漏洞影响,揭示其可被用于绕过安全检测。
A Deep Dive into Function Inlining and its Security Implications for ML-based Binary Analysis
- 剖析LLVM内联决策流程,设计极端内联场景以测试模型鲁棒性
- 发现内联会显著干扰静态特征,导致多种机器学习模型失效
- 提醒安全研究者关注编译器设置对模型训练评估的一致性影响
函数内联是现代编译器中广泛应用的优化技术,通过将调用点替换为被调用函数体来提升性能。尽管该操作在意图上无害,但会显著改变机器指令和控制流图等静态特征,而这些特征正是二进制分析的关键输入。然而,其安全影响至今未受充分关注。本文首次从机器学习驱动的二进制分析视角出发,系统研究函数内联的影响。我们深入分析了LLVM成本模型中的内联决策流程,并探索了能大幅提高内联率的编译选项组合,称为极端内联。针对五个与安全相关的机器学习辅助二进制分析任务,使用20个不同模型进行系统评估。实验表明:(i) 内联虽为良性变换,却可能间接影响机器学习模型行为,被用于逃避判别或生成式模型;(ii) 依赖静态特征的模型对内联高度敏感;(iii) 微小的编译器设置即可被恶意利用以生成规避样本;(iv) 不同应用与构建配置下的内联率差异显著,破坏了模型训练与评估中对一致性的假设。
原文摘要 · Abstract (English)
A function inlining optimization is a widely used transformation in modern compilers, which replaces a call site with the callee's body in need. While this transformation improves performance, it significantly impacts static features such as machine instructions and control flow graphs, which are crucial to binary analysis. Yet, despite its broad impact, the security impact of function inlining remains underexplored to date. In this paper, we present the first comprehensive study of function inlining through the lens of machine learning-based binary analysis. To this end, we dissect the inlining decision pipeline within the LLVM's cost model and explore the combinations of the compiler options that aggressively promote the function inlining ratio beyond standard optimization levels, which we term extreme inlining. We focus on five ML-assisted binary analysis tasks for security, using 20 unique models to systematically evaluate their robustness under extreme inlining scenarios. Our extensive experiments reveal several significant findings: i) function inlining, though a benign transformation in intent, can (in)directly affect ML model behaviors, being potentially exploited by evading discriminative or generative ML models; ii) ML models relying on static features can be highly sensitive to inlining; iii) subtle compiler settings can be leveraged to deliberately craft evasive binary variants; and iv) inlining ratios vary substantially across applications and build configurations, undermining assumptions of consistency in training and evaluation of ML models.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。