Skip to Main content Skip to Navigation
Conference papers

DSAC: Effective Static Analysis of Sleep-in-Atomic-Context Bugs in Kernel Modules

Abstract : In a modern OS, kernel modules often use spinlocks and interrupt handlers to monopolize a CPU core to execute concurrent code in atomic context. In this situation, if the kernel module performs an operation that can sleep at runtime, a system hang may occur. We refer to this kind of concurrency bug as a sleep-in-atomic-context (SAC) bug. In practice, SAC bugs have received insufficient attention and are hard to find, as they do not always cause problems in real executions. In this paper, we propose a practical static approach named DSAC, to effectively detect SAC bugs and automatically recommend patches to help fix them. DSAC uses four key techniques: (1) a hybrid of flow-sensitive and-insensitive analysis to perform accurate and efficient code analysis; (2) a heuristics-based method to accurately extract kernel interfaces that can sleep at runtime; (3) a path-check method to effectively filter out repeated reports and false bugs; (4) a pattern-based method to automatically generate recommended patches to help fix the bugs. We evaluate DSAC on kernel modules (drivers, file systems, and network modules) of the Linux kernel, and on the FreeBSD and NetBSD kernels, and in total find 401 new real bugs. 272 of these bugs have been confirmed by the relevant kernel maintainers, and 43 patches generated by DSAC have been applied by kernel maintainers.
Complete list of metadatas

Cited literature [52 references]  Display  Hide  Download

https://hal.inria.fr/hal-01853268
Contributor : Julia Lawall <>
Submitted on : Friday, August 3, 2018 - 9:48:54 AM
Last modification on : Friday, July 5, 2019 - 3:26:03 PM
Document(s) archivé(s) le : Sunday, November 4, 2018 - 12:26:51 PM

File

atc18-bai.pdf
Publisher files allowed on an open archive

Identifiers

  • HAL Id : hal-01853268, version 1

Citation

Jia-Ju Bai, Yu-Ping Wang, Julia Lawall, Shi-Min Hu. DSAC: Effective Static Analysis of Sleep-in-Atomic-Context Bugs in Kernel Modules. 2018 USENIX Annual Technical Conference, Jul 2018, Boston, MA, United States. ⟨hal-01853268⟩

Share

Metrics

Record views

884

Files downloads

137