Affiliation:
1. Tsinghua University, Beijing, China
2. Sorbonne University/Inria/LIP6, Paris, France
Abstract
Atomic context is an execution state of the Linux kernel in which kernel code monopolizes a CPU core. In this state, the Linux kernel may only perform operations that cannot sleep, as otherwise a system hang or crash may occur. We refer to this kind of concurrency bug as a sleep-in-atomic-context (SAC) bug. In practice, SAC bugs are hard to find, as they do not cause problems in all executions.
In this article, we propose a practical static approach named DSAC to effectively detect SAC bugs in the Linux kernel. DSAC uses three key techniques: (1) a summary-based analysis to identify the code that may be executed in atomic context, (2) a connection-based alias analysis to identify the set of functions referenced by a function pointer, and (3) a path-check method to filter out repeated reports and false bugs. We evaluate DSAC on Linux 4.17 and find 1,159 SAC bugs. We manually check all the bugs and find that 1,068 bugs are real. We have randomly selected 300 of the real bugs and sent them to kernel developers. 220 of these bugs have been confirmed, and 51 of our patches fixing 115 bugs have been applied.
Funder
China Postdoctoral Science Foundation
Publisher
Association for Computing Machinery (ACM)
Reference59 articles.
1. Allocation 2018. Linux kernel documentation for memory allocation. Retrieved from https://www.kernel.org/doc/htmldocs/kernel-api/API-kmalloc.html. Allocation 2018. Linux kernel documentation for memory allocation. Retrieved from https://www.kernel.org/doc/htmldocs/kernel-api/API-kmalloc.html.
2. Automatic verification of active device drivers
3. DCNS
Cited by
3 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. SPATA: Effective OS Bug Detection with Summary-Based, Alias-Aware and Path-Sensitive Typestate Analysis;ACM Transactions on Computer Systems;2024-09-06
2. Path-sensitive and alias-aware typestate analysis for detecting OS bugs;Proceedings of the 27th ACM International Conference on Architectural Support for Programming Languages and Operating Systems;2022-02-22
3. Hawkeye: Eliminating Kernel Address Leakage in Normal Data Flows;IEEE Transactions on Dependable and Secure Computing;2022