KNighter: Transforming Static Analysis with LLM-Synthesized Checkers

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Yang, Chenyuan, Zhao, Zijie, Xie, Zichen, Li, Haoyu, Zhang, Lingming
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866912569186320384
author Yang, Chenyuan
Zhao, Zijie
Xie, Zichen
Li, Haoyu
Zhang, Lingming
author_facet Yang, Chenyuan
Zhao, Zijie
Xie, Zichen
Li, Haoyu
Zhang, Lingming
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2503_09002
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle KNighter: Transforming Static Analysis with LLM-Synthesized Checkers
Yang, Chenyuan
Zhao, Zijie
Xie, Zichen
Li, Haoyu
Zhang, Lingming
Software Engineering
Artificial Intelligence
Cryptography and Security
Operating Systems
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.
title KNighter: Transforming Static Analysis with LLM-Synthesized Checkers
topic Software Engineering
Artificial Intelligence
Cryptography and Security
Operating Systems
url https://arxiv.org/abs/2503.09002