Static Detection of Unsafe DMA Accesses in Device Drivers
Investigate security risks posed by Direct Memory Access (DMA) in device drivers. Researchers propose a static approach for identifying and preventing unsafe DMA accesses. The study addresses various challenges and provides an evaluation of the proposed method.
Download Presentation

Please find below an Image/Link to download the presentation.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.
You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.
E N D
Presentation Transcript
Static Detection of Unsafe DMA Accesses in Device Drivers Jia-Ju Bai (Tsinghua University) Tuo Li (Tsinghua University) Kangjie Lu (University of Minnesota) Shi-Min Hu (Tsinghua University) USENIX Security 21 1
Outline DMA Challenge SADA Approach Evaluation Conclusion 2
DMA 3
DMA type Coherent DMA buffer Synchronous Streaming DMA buffer Asynchronous 4
DMA Problems DMA attack Invalid mapping Improper checking of buffer creation Buffer-destroy omission 5
Security Risks of DMA Accesses Streaming DMA access Inconsistent DMA access 6
Security Risks of DMA Accesses Coherent DMA access Unchecked DMA access 7
DMA 9
DMA 10
Outline DMA Challenge SADA Approach Evaluation Conclusion 11
Challenges Identifying DMA accesses Checking the safety of DMA accesses Dropping false positives 12
Challenges 1: Identifying DMA accesses Identifying DMA accesses Handling DMA-buffer creation Identifying DMA accesses 13
Challenges 1: Identifying DMA accesses Identifying DMA accesses Handling DMA-buffer creation Identifying DMA accesses 14
Challenges 1: Identifying DMA accesses Identifying DMA accesses Handling DMA-buffer creation Identifying DMA accesses 15
Challenges 2: DMA-Access Safety Checking DMA-Access Safety Checking Checking streaming DMA access Checking coherent DMA access. Infinite looping Buffer overflow Invalid-pointer access Taint analysis 16
Challenges 2: DMA-Access Safety Checking DMA-Access Safety Checking Checking streaming DMA access Checking coherent DMA access. Infinite looping Buffer overflow Invalid-pointer access Taint analysis 17
Challenges 2: DMA-Access Safety Checking DMA-Access Safety Checking Checking streaming DMA access Checking coherent DMA access. Infinite looping Buffer overflow Invalid-pointer access Taint analysis 18
Challenges 2: DMA-Access Safety Checking DMA-Access Safety Checking Checking streaming DMA access Checking coherent DMA access. Infinite looping Buffer overflow Invalid-pointer access Taint analysis 19
Challenges 2: DMA-Access Safety Checking DMA-Access Safety Checking Checking streaming DMA access Checking coherent DMA access. Infinite looping Buffer overflow Invalid-pointer access Taint analysis 20
Challenges 2: DMA-Access Safety Checking DMA-Access Safety Checking Checking streaming DMA access Checking coherent DMA access. Infinite looping Buffer overflow Invalid-pointer access Taint analysis 21
Challenges 3: Code-Path Validation Code-Path Validation SMT solver Z3 Getting path constraints Adding constraints for triggering security bugs Solving all constraints 22
Outline DMA Challenge SADA Approach Evaluation Conclusion 23
Outline DMA Challenge SADA Approach Evaluation Conclusion 25
Evaluation Eight Intel i7-3770 CPU@3.40GHz processors 16GB physical memory. x86-64 Linux 5.6 Configuration : allyesconfig 26
Evaluation Detection of Unsafe DMA Accesses Analyzing driver code It spends 270 minutes on analyzing 8.8M lines of source code in 14.6K source files. Identifying DMA accesses It identifies over 28K DMA accesses according to 2,781 created DMA buffers. Detecting unsafe DMA accesses SADA finds 321 unsafe DMA accesses, including 131 inconsistent DMA accesses and 190 unchecked DMA accesses. Security impact of unsafe DMA accesses Inconsistent DMA accesses: 123 Buffer-overflow: 121 Invalid-pointer accesses: 36 Infinite looping: 4 27
Evaluation False Positives and Negatives False positives The alias analyses used in SADA can make mistakes. False negatives Wrapper functions Function-pointer Neglect driver concurrency 28
Evaluation Root Causes and Fixing Suggestions 29
Outline DMA Challenge SADA Approach Evaluation Conclusion 30
Conclusion We propose a static approach named SADA, to automatically and accurately detect unsafe DMA accesses in device drivers. SADA integrates three key techniques, including a field-based alias analysis to identify DMA accesses, a flow-sensitive and pattern-based analysis to check the safety of each DMA access, and a code-path validation method to drop false positives. SADA finds 284 real unsafe DMA accesses, which can cause unexpected hardware behaviors or trigger security bugs. 31
END END 32