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

缓解补丁移植中的隐含不一致

Mitigating Implicit Inconsistencies in Patch Porting

The State Key Laboratory of Blockchain and Data Security, Zhejiang University(浙江大学区块链与数据安全全国重点实验室);Waterloo Research Center, Huawei(华为 Waterloo 研究中心);College of Computer Science and Technology, Zhejiang University(浙江大学计算机科学与技术学院);Hangzhou High-Tech Zone (Binjiang) Institute of Blockchain and Data Security(杭州高新区(滨江)区块链与数据安全研究院)

Shengyi Pan, Zhongxin Liu, Jiayuan Zhou, Xing Hu, Xin Xia, Shanping Li

AI总结:

本文提出MIP方法,通过LLM、编译器和代码分析工具协作,解决补丁移植中的隐含不一致问题,实验显示其在跨仓库和分支场景中效果显著。

摘要:

及时将补丁从源代码库移植到其变体(如分支和fork)对于缓解传播缺陷和漏洞至关重要。最近的研究探索了自动化补丁移植以减少手动工作和延迟,但现有方法主要处理补丁局部上下文中的不一致,难以处理需要在代码库之间进行全局映射知识的不一致。我们称此类非局部不一致为隐含不一致。隐含不一致由于其非局部性质,给开发者带来更大挑战。为了解决这些问题,我们提出了MIP,它使LLM、编译器和代码分析工具能够协作。MIP针对不同情况采用不同策略:当源标识符存在于目标代码库时,它利用编译器诊断;否则,它从两个代码库中检索匹配的代码段对作为缓解的映射知识。在两个代表性的场景(跨fork和跨分支补丁移植)上的实验表明,MIP在两种设置中成功解决的补丁数量比最佳基线方法多出两倍以上。与我们行业合作伙伴的用户研究进一步证明了其实际有效性。

英文摘要:

Promptly porting patches from a source codebase to its variants (e.g., forks and branches) is essential for mitigating propagated defects and vulnerabilities. Recent studies have explored automated patch porting to reduce manual effort and delay, but existing approaches mainly handle inconsistencies visible in a patch's local context and struggle with those requiring global mapping knowledge between codebases. We refer to such non-local inconsistencies as implicit inconsistencies. Implicit inconsistencies pose greater challenges for developers to resolve due to their non-local nature. To address them, we propose MIP, which enables collaboration among an LLM, a compiler, and code analysis utilities. MIP adopts different strategies for different cases: when source identifiers exist in the target codebase, it leverages compiler diagnostics; otherwise, it retrieves matched code segment pairs from the two codebases as mapping knowledge for mitigation. Experiments on two representative scenarios, cross-fork and cross-branch patch porting, show that MIP successfully resolves more than twice as many patches as the best-performing baseline in both settings. A user study with our industry partner further demonstrates its practical effectiveness.

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

↑