arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2503.09002cs.SEcs.AIcs.CRcs.OS
收藏

KNighter:利用LLM合成的检查器变革静态分析

KNighter: Transforming Static Analysis with LLM-Synthesized Checkers

University of Illinois Urbana-Champaign(伊利诺伊大学厄巴纳-香槟分校);Zhejiang University(浙江大学);Shanghai Jiao Tong University(上海交通大学)

Chenyuan Yang, Zijie Zhao, Zichen Xie, Haoyu Li, Lingming Zhang

AI总结:

针对静态分析工具开发难、LLM直接扫描大型系统不现实的问题,提出KNighter方法,利用LLM基于历史漏洞模式合成专用静态检查器,经多阶段验证优化,在Linux内核中发现大量长期潜伏的关键漏洞,建立了可扩展的LLM静态分析新范式。

摘要:

静态分析是在操作系统内核等关键系统中检测漏洞的强大技术。然而,设计和实现静态分析工具极具挑战性、耗时,且通常局限于预定义的漏洞模式。尽管大语言模型(LLM)已在静态分析领域展现出潜力,但受限于计算成本和上下文长度约束,直接将其用于扫描大型系统仍不切实际。\n 我们提出KNighter——首个通过从历史漏洞模式中自动合成静态分析工具,实现可扩展的基于LLM的静态分析的方法。我们的核心洞见是:无需使用LLM直接分析海量系统,而是借助历史补丁知识,利用LLM生成专用的静态分析工具。KNighter通过一个多阶段合成流水线实现这一构想:该流水线对照原始补丁验证检查器的正确性,并采用自动化优化流程迭代降低误报率。我们在Linux内核上的评估表明,KNighter生成的检查器精度很高,能够检测出现有人工编写的分析工具所遗漏的多种漏洞模式。截至目前,KNighter合成的检查器已在Linux内核中发现92个新的、关键的、长期潜伏的漏洞(平均潜伏时长4.3年);其中77个已确认,57个已修复,30个已分配CVE编号。这项工作通过检查器合成,为面向真实世界系统的可扩展、可靠且可追溯的基于LLM的静态分析建立了全新范式。

英文摘要:

Static analysis is a powerful technique for bug detection in critical systems like operating system kernels. However, designing and implementing static analyzers is challenging, time-consuming, and typically limited to predefined bug patterns. While large language models (LLMs) have shown promise for static analysis, directly applying them to scan large systems remains impractical due to computational constraints and contextual limitations. We present KNighter, the first approach that unlocks scalable LLM-based static analysis by automatically synthesizing static analyzers from historical bug patterns. Rather than using LLMs to directly analyze massive systems, our key insight is leveraging LLMs to generate specialized static analyzers guided by historical patch knowledge. KNighter implements this vision through a multi-stage synthesis pipeline that validates checker correctness against original patches and employs an automated refinement process to iteratively reduce false positives. Our evaluation on the Linux kernel demonstrates that KNighter generates high-precision checkers capable of detecting diverse bug patterns overlooked by existing human-written analyzers. To date, KNighter-synthesized checkers have discovered 92 new, critical, long-latent bugs (average 4.3 years) in the Linux kernel; 77 are confirmed, 57 fixed, and 30 have been assigned CVE numbers. This work establishes an entirely new paradigm for scalable, reliable, and traceable LLM-based static analysis for real-world systems via checker synthesis.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑