Lune

USENIX Security2021顶会

Static Detection of Unsafe DMA Accesses in Device Drivers

Jia-Ju Bai, Tuo Li, Kangjie Lu, Shi-Min Hu

摘要

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 patternbased 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.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 19 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • Where Does It Go?: Refining Indirect-Call Targets with Multi-Layer Type Analysis 引用了 MoonShine: Optimizing OS Fuzzer Seed Selection with Trace Distillation
  • Saturn: Host-Gadget Synergistic USB Driver Fuzzing 引用了 PrIntFuzz: fuzzing Linux drivers via automated virtual device simulation
  • Saturn: Host-Gadget Synergistic USB Driver Fuzzing 引用了 MoonShine: Optimizing OS Fuzzer Seed Selection with Trace Distillation
  • Saturn: Host-Gadget Synergistic USB Driver Fuzzing 引用了 DIFUZE: Interface Aware Fuzzing for Kernel Drivers
  • PrIntFuzz: fuzzing Linux drivers via automated virtual device simulation 引用了 MoonShine: Optimizing OS Fuzzer Seed Selection with Trace Distillation
  • PrIntFuzz: fuzzing Linux drivers via automated virtual device simulation 引用了 IMF: Inferred Model-based Fuzzer
  • PrIntFuzz: fuzzing Linux drivers via automated virtual device simulation 引用了 DIFUZE: Interface Aware Fuzzing for Kernel Drivers
  • MoonShine: Optimizing OS Fuzzer Seed Selection with Trace Distillation 引用了 IMF: Inferred Model-based Fuzzer
  • Improving Indirect-Call Analysis in LLVM with Type and Data-Flow Co-Analysis 引用了 Where Does It Go?: Refining Indirect-Call Targets with Multi-Layer Type Analysis
  • SyzDirect: Directed Greybox Fuzzing for Linux Kernel 引用了 Where Does It Go?: Refining Indirect-Call Targets with Multi-Layer Type Analysis
  • SyzDirect: Directed Greybox Fuzzing for Linux Kernel 引用了 MoonShine: Optimizing OS Fuzzer Seed Selection with Trace Distillation
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper19

  1. SyzDirect: Directed Greybox Fuzzing for Linux KernelXin Tan, Yuan Zhang, Jiadong Lu, Xin Xiong 等CCS 2023 · 25 次引用
  2. PrIntFuzz: fuzzing Linux drivers via automated virtual device simulationZheyu Ma, Bodong Zhao, Letu Ren, Zheming Li 等ISSTA 2022 · 23 次引用
  3. Saturn: Host-Gadget Synergistic USB Driver FuzzingYiru Xu, Hao Sun, Jianzhong Liu, Yuheng Shen 等S&P 2024 · 13 次引用
  4. Improving Indirect-Call Analysis in LLVM with Type and Data-Flow Co-AnalysisDinghao Liu, Shouling Ji, Kangjie Lu, Qinming HeUSENIX Security 2024 · 13 次引用
  5. LR-Miner: Static Race Detection in OS Kernels by Mining Locking RulesTuo Li, Jia-Ju Bai, Gui-Dong Han, Shi-Min HuUSENIX Security 2024 · 6 次引用

它引用的 Paper16

  1. A2: Analog Malicious HardwareKaiyuan Yang, Matthew Hicks, Qing Dong, Todd M. Austin 等S&P 2016 · 242 次引用
  2. DIFUZE: Interface Aware Fuzzing for Kernel DriversJake Corina, Aravind Machiry, Christopher Salls, Yan Shoshitaishvili 等CCS 2017 · 195 次引用
  3. MoonShine: Optimizing OS Fuzzer Seed Selection with Trace DistillationShankara Pailoor, Andrew Aday, Suman JanaUSENIX Security 2018 · 180 次引用
  4. Where Does It Go?: Refining Indirect-Call Targets with Multi-Layer Type AnalysisKangjie Lu, Hong HuCCS 2019 · 142 次引用
  5. IMF: Inferred Model-based FuzzerHyungSeok Han, Sang Kil ChaCCS 2017 · 139 次引用

相关 Paper

  1. Dynamic Detection of Vulnerable DMA Race ConditionsBrian Johannesmeyer, Raphael Isemann, Cristiano Giuffrida, Herbert BosCCS 2025
  2. Characterizing, exploiting, and detecting DMA code injection vulnerabilities in the presence of an IOMMUAlex Markuze, Shay Vargaftik, Gil Kupfer, Boris Pismenny 等EuroSys 2021 · 22 次引用
  3. GDMA: Fully Automated DMA Rehosting via Iterative Type OverlaysTobias Scharnowski, Simeon Hoffmann, Moritz Bley, Simon Wörner 等USENIX Security 2025
  4. DR. CHECKER: A Soundy Analysis for Linux Kernel DriversAravind Machiry, Chad Spensky, Jake Corina, Nick Stephens 等USENIX Security 2017 · 126 次引用
  5. DICE: Automatic Emulation of DMA Input Channels for Dynamic Firmware AnalysisAlejandro Mera, Bo Feng, Long Lu, Engin KirdaS&P 2021 · 81 次引用
黄昏的海面,两侧是细线勾勒的悬崖