Compiler-based Control-Flow Integrity (CFI) offers strong forward-edge protection but remains challenging to deploy in large C/C++ software due to visibility mismatches, type inconsistencies, and unintended behavioral failures. We present CFIghter, the first fully automated system that enables strict, type-based CFI in real-world projects by detecting, classifying, and repairing unintended policy violations exposed by the test suite. CFIghter integrates whole-program analysis with guided runtime monitoring and iteratively applies the minimal necessary adjustments to CFI enforcement only where required, stopping once all tests pass or remaining failures are deemed unresolvable. We evaluate CFIghter on four GNU projects. It resolves all visibility-related build errors and automatically repairs 95.8% of unintended CFI violations in the large, multi-library util-linux codebase, while retaining strict enforcement at over 89% of indirect control-flow sites. Across all subjects, CFIghter preserves strict type-based CFI for the majority of the codebase without requiring manual source-code changes, relying only on automatically generated visibility adjustments and localized enforcement scopes where necessary. These results show that automated compatibility repair makes strict compiler CFI practically deployable in mature, modular C software.
翻译:基于编译器的控制流完整性(CFI)能够提供强大的前向边保护,但由于可见性不匹配、类型不一致以及非预期的行为故障等问题,其在大规模C/C++软件中的部署仍面临挑战。本文提出了CFIghter,这是首个完全自动化的系统,能够通过检测、分类并修复测试套件暴露的非预期策略违规,在实际项目中实现严格的基于类型的CFI。CFIghter将全程序分析与引导式运行时监控相结合,仅在必要处迭代应用对CFI强制实施的最小必要调整,直至所有测试通过或判定剩余故障无法解决为止。我们在四个GNU项目上对CFIghter进行了评估。该系统解决了所有与可见性相关的构建错误,并在大型多库的util-linux代码库中自动修复了95.8%的非预期CFI违规,同时在超过89%的间接控制流站点保持了严格强制。在所有实验对象中,CFIghter为大部分代码库保留了严格的基于类型的CFI,无需手动修改源代码,仅依赖自动生成的可见性调整以及在必要时局部化的强制作用域。这些结果表明,自动化兼容性修复使得严格的编译器CFI能够在成熟的模块化C软件中实际部署。