arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2510.14036cs.SEcs.AI
收藏

一个Bug,数百个隐患:利用LLM进行大规模Bug发现

One Bug, Hundreds Behind: LLMs for Large-Scale Bug Discovery

IBM Research(IBM研究院);William & Mary(威廉与玛丽大学)

Qiushi Wu, Yue Xiao, Dhilung Kirat, Kevin Eykholt, Jiyong Jang, Douglas Lee Schales

AI总结:

本文针对大型程序中反复出现但未解决的重复模式Bug,提出基于LLVM和LLM的BugStone系统,利用已修补实例识别错误模式,在Linux内核中发现大量新问题,并构建数据集验证其高效性。

摘要:

修复大型程序中的Bug是一项极具挑战性的任务,需要耗费大量的时间和精力。一旦发现Bug,就会报告给项目维护者,维护者与报告者合作修复并最终关闭该问题。然而,在整个程序中,通常存在相似的代码段,这些代码段可能也包含该Bug,但在发现过程中被遗漏了。逐一查找并修复每个重复出现的Bug实例是劳动密集型的。更令人担忧的是,Bug报告可能无意中扩大攻击面,因为它们为攻击者提供了一种可利用的模式,该模式可能在程序的其他部分尚未解决。在本文中,我们探讨了这些重复模式Bug(RPB),它们源于同一根本原因,反复出现在程序的不同代码段甚至不同程序中,但尚未解决。我们的调查显示,RPB广泛存在,并可能严重损害软件程序的安全性。本文介绍了BugStone,一个由LLVM和大语言模型(LLM)驱动的程序分析系统。关键观察是,许多RPB都有一个已修补的实例,可以利用该实例来识别一致的错误模式,例如特定的API误用。通过在整个程序中检查该模式,可以识别可能易受攻击的相似代码段。从135个独特的RPB开始,BugStone在Linux内核中识别出超过22K个新的潜在问题。对其中400个发现的手动分析确认了246个是有效的。我们还从23个近期顶级会议工作报告的超过1.9K个安全Bug中创建了一个数据集。我们手动注释该数据集,识别出80个重复模式和850个相应的修复。即使采用成本效益高的模型选择,BugStone在该数据集上实现了92.2%的精确率和79.1%的成对准确率。

英文摘要:

Fixing bugs in large programs is a challenging task that demands substantial time and effort. Once a bug is found, it is reported to the project maintainers, who work with the reporter to fix it and eventually close the issue. However, across the program, there are often similar code segments, which may also contain the bug, but were missed during discovery. Finding and fixing each recurring bug instance individually is labor intensive. Even more concerning, bug reports can inadvertently widen the attack surface as they provide attackers with an exploitable pattern that may be unresolved in other parts of the program. In this paper, we explore these Recurring Pattern Bugs (RPBs) that appear repeatedly across various code segments of a program or even in different programs, stemming from a same root cause, but are unresolved. Our investigation reveals that RPBs are widespread and can significantly compromise the security of software programs. This paper introduces BugStone, a program analysis system empowered by LLVM and a Large Language Model (LLM). The key observation is that many RPBs have one patched instance, which can be leveraged to identify a consistent error pattern, such as a specific API misuse. By examining the entire program for this pattern, it is possible to identify similar sections of code that may be vulnerable. Starting with 135 unique RPBs, BugStone identified more than 22K new potential issues in the Linux kernel. Manual analysis of 400 of these findings confirmed that 246 were valid. We also created a dataset from over 1.9K security bugs reported by 23 recent top-tier conference works. We manually annotate the dataset, identify 80 recurring patterns and 850 corresponding fixes. Even with a cost-efficient model choice, BugStone achieved 92.2% precision and 79.1% pairwise accuracy on the dataset.

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

↑