During system call execution, it is common for operating system kernels to read userspace memory multiple times (multi-reads). A critical bug may exist if the fetched userspace memory is subject to change across these reads, i.e., a race condition, which is known as a double-fetch bug. Prior works have attempted to detect these bugs both statically and dynamically. However, due to their improper assumptions and imprecise definitions regarding double-fetch bugs, their multi-read detection is inherently limited and suffers from significant false positives and false negatives. For example, their approach is unable to support device emulation, inter-procedural analysis, loop handling, etc. More importantly, they completely leave the task of finding real double-fetch bugs from the haystack of multi-reads to manual verification, which is expensive if possible at all. In this paper, we first present a formal and precise definition of double-fetch bugs and then implement a static analysis system-Deadline-to automatically detect double-fetch bugs in OS kernels. Deadline uses static program analysis techniques to systematically find multi-reads throughout the kernel and employs specialized symbolic checking to vet each multi-read for double-fetch bugs. We apply Deadline to Linux and FreeBSD kernels and find 23 new bugs in Linux and one new bug in FreeBSD. We further propose four generic strategies to patch and prevent double-fetch bugs based on our study and the discussion with kernel maintainers.
|Original language||English (US)|
|Title of host publication||Proceedings - 2018 IEEE Symposium on Security and Privacy, SP 2018|
|Publisher||Institute of Electrical and Electronics Engineers Inc.|
|Number of pages||18|
|State||Published - Jul 23 2018|
|Event||39th IEEE Symposium on Security and Privacy, SP 2018 - San Francisco, United States|
Duration: May 21 2018 → May 23 2018
|Name||Proceedings - IEEE Symposium on Security and Privacy|
|Other||39th IEEE Symposium on Security and Privacy, SP 2018|
|Period||5/21/18 → 5/23/18|
Bibliographical noteFunding Information:
We thank the anonymous reviewers for their helpful feedback. This research was supported, in part, by the NSF under award DGE-1500084, CNS-1563848, CNS-1704701, and CRI-1629851, ONR under grants N00014-15-1-2162 and N00014-17-1-2895, DARPA TC (No. DARPA FA8650-15-C-7556), ETRI IITP/KEIT[B0101-17-0644], the German Ministry of Education and Research (BMBF), and gifts from Facebook, Mozilla and Intel.
We thank the anonymous reviewersfor their helpful feedback. This research was supported, in part, by the NSF under award DGE-1500084, CNS-1563848, CNS-1704701, and CRI-1629851, ONR under grants N00014-15-1-2162 and N00014-17-1-2895, DARPA TC (No. DARPA FA8650-15-C-7556), ETRI IITP/KEIT[B0101-17-0644], the German Ministry of Education and Research (BMBF), and gifts from Facebook, Mozilla and Intel.
© 2018 IEEE.