一种基于离群点的上下文敏感静态分析,用于发现内核竞态条件
A Context-Sensitive, Outlier-Based Static Analysis to Find Kernel Race Conditions
AI总结:
本文提出一种基于离群点且具有上下文敏感机制的静态分析方法,通过推断字段加锁规则来检测内核竞态条件,并在 Linux v5.14.11 中发现 24 个经维护者确认的缺陷。
摘要:
竞态条件是软件中的一类缺陷,其中对共享资源的并发访问未受到相互保护。竞态条件的后果包括权限提升、拒绝服务以及内存损坏,后者可能进一步导致任意代码执行。然而,在大型代码库中,关于哪些字段应在哪些锁的保护下被访问的确切规则并不总是清晰。我们提出一种新颖的静态技术,该技术推断字段访问应如何加锁的规则,然后依据这些规则检查代码。传统的用于检测竞态条件的静态分析器基于锁集分析。与之不同,我们提出一种基于离群点的技术,并辅以具有良好可扩展性的上下文敏感机制。我们已在 LLIF 中实现了该分析,并对其进行了评估,以发现 Linux v5.14.11 中未受正确保护的字段访问。我们全面评估了其发现竞态条件的能力,并研究了误报产生的原因。此外,我们报告了其中一部分问题并提交了补丁。维护者确认了 24 个缺陷。
英文摘要:
Race conditions are a class of bugs in software where concurrent accesses to shared resources are not protected from each other. Consequences of race conditions include privilege escalation, denial of service, and memory corruption which can potentially lead to arbitrary code execution. However, in large code bases the exact rules as to which fields should be accessed under which locks are not always clear. We propose a novel static technique that infers rules for how field accesses should be locked, and then checks the code against these rules. Traditional static analysers for detecting race conditions are based on lockset analysis. Instead, we propose an outlier-based technique enhanced with a context-sensitive mechanism that scales well. We have implemented this analysis in LLIF, and evaluated it to find incorrectly protected field accesses in Linux v5.14.11. We thoroughly evaluate its ability to find race conditions, and study the causes for false positive reports. In addition, we reported a subset of the issues and submitted patches. The maintainers confirmed 24 bugs.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。