跳到主要导航 跳到搜索 跳到主要内容

Static detection of unsafe DMA accesses in device drivers

  • Tsinghua University
  • University of Minnesota Twin Cities

科研成果: 书/报告/会议事项章节会议稿件同行评审

摘要

Direct Memory Access (DMA) is a popular mechanism for improving hardware I/O performance, and it has been widely used by many existing device drivers. However, DMA accesses can be unsafe, from two aspects. First, without proper synchronization of DMA buffers with hardware registers and CPU cache, the buffer data stored in CPU cache and hardware registers can be inconsistent, which can cause unexpected hardware behaviors. Second, a malfunctioning or untrusted hardware device can write bad data into system memory, which can trigger security bugs (such as buffer overflow and invalid-pointer access), if the driver uses the data without correct validation. To detect unsafe DMA accesses, some key challenges need to be solved. For example, because each DMA access is implemented as a regular variable access in the driver code, identifying DMA accesses is difficult. In this paper, we propose a static-analysis approach named SADA, to automatically and accurately detect unsafe DMA accesses in device drivers. SADA consists of three basic steps. First, SADA uses a field-based alias analysis to identify DMA accesses, according to the information of DMA-buffer creation. Second, SADA uses a flow-sensitive and pattern-based analysis to check the safety of each DMA access, to detect possible unsafe DMA accesses. Finally, SADA uses an SMT solver to validate the code-path condition of each possible unsafe DMA access, to drop false positives. We have evaluated SADA on the driver code of Linux 5.6, and found 284 real unsafe DMA accesses. Among them, we highlight that 121 can trigger buffer-overflow bugs and 36 can trigger invalid-pointer accesses causing arbitrary read or write. We have reported these unsafe DMA accesses to Linux driver developers, and 105 of them have been confirmed.

源语言英语
主期刊名Proceedings of the 30th USENIX Security Symposium
出版商USENIX Association
1629-1645
页数17
ISBN(电子版)9781939133243
出版状态已出版 - 2021
已对外发布
活动30th USENIX Security Symposium, USENIX Security 2021 - Virtual, Online
期限: 11 8月 202113 8月 2021

出版系列

姓名Proceedings of the 30th USENIX Security Symposium

会议

会议30th USENIX Security Symposium, USENIX Security 2021
Virtual, Online
时期11/08/2113/08/21

指纹

探究 'Static detection of unsafe DMA accesses in device drivers' 的科研主题。它们共同构成独一无二的指纹。

引用此