Understanding and Detecting Disordered Error Handling with Precise Function Pairing
Qiushi Wu, Aditya Pakki, Navid Emamdoost, Stephen McCamant, Kangjie Lu
摘要
Software programs may frequently encounter various errors such as allocation failures. Error handling aims to gracefully deal with the errors to avoid security and reliability issues, thus it is prevalent and vital. However, because of its complexity and corner cases, error handling itself is often erroneous, and prior research has primarily focused on finding bugs in the handling part, such as incorrect error-code returning or missing error propagation. In this paper, we propose and investigate a class of bugs in error-handling code from a different perspective. In particular, we find that programs often perform "cleanup" operations before the actual error handling, such as freeing memory or decreasing refcount. Critical bugs occur when these operations are performed (1) in an incorrect order, (2) redundantly, or (3) inadequately. We refer to such bugs as Disordered Error Handling (DiEH). Our investigation reveals that DiEH bugs are not only common but can also cause security problems such as privilege escalation, memory corruption, and denial-of-service. Based on the findings from the investigation, we then develop a system, HERO (Handling ERrors Orderly), to automatically detect DiEH. The core of HERO is a novel technique that precisely pairs both common and custom functions based on the unique error-handling structures, which allows us to infer expected cleanup functions. With HERO, we found 239 DiEH bugs in the Linux kernel, the FreeBSD kernel, and OpenSSL, which can cause security and reliability issues. The evaluation results show that DiEH is critical and widely exists in system software, and HERO is effective in detecting DiEH. We also believe that the precise function pairing is of independent interest in other research areas such as temporal-rule inference and race detection.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 24 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Where Does It Go?: Refining Indirect-Call Targets with Multi-Layer Type Analysis 引用了 APISan: Sanitizing API Usages through Semantic Cross-Checking
- Where Does It Go?: Refining Indirect-Call Targets with Multi-Layer Type Analysis 引用了 Detecting Missing-Check Bugs via Semantic- and Context-Aware Criticalness and Constraints Inferences
- Saturn: Host-Gadget Synergistic USB Driver Fuzzing 引用了 PeriScope: An Effective Probing and Fuzzing Framework for the Hardware-OS Boundary
- Saturn: Host-Gadget Synergistic USB Driver Fuzzing 引用了 PrIntFuzz: fuzzing Linux drivers via automated virtual device simulation
- Saturn: Host-Gadget Synergistic USB Driver Fuzzing 引用了 DIFUZE: Interface Aware Fuzzing for Kernel Drivers
- PeriScope: An Effective Probing and Fuzzing Framework for the Hardware-OS Boundary 引用了 DIFUZE: Interface Aware Fuzzing for Kernel Drivers
- PrIntFuzz: fuzzing Linux drivers via automated virtual device simulation 引用了 PeriScope: An Effective Probing and Fuzzing Framework for the Hardware-OS Boundary
- PrIntFuzz: fuzzing Linux drivers via automated virtual device simulation 引用了 Detecting Missing-Check Bugs via Semantic- and Context-Aware Criticalness and Constraints Inferences
- PrIntFuzz: fuzzing Linux drivers via automated virtual device simulation 引用了 DIFUZE: Interface Aware Fuzzing for Kernel Drivers
- 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
- Improving Indirect-Call Analysis in LLVM with Type and Data-Flow Co-Analysis 引用了 Detecting Missing-Check Bugs via Semantic- and Context-Aware Criticalness and Constraints Inferences
- Improving Indirect-Call Analysis in LLVM with Type and Data-Flow Co-Analysis 引用了 Detecting Missed Security Operations Through Differential Checking of Object-based Similar Paths
- Improving Indirect-Call Analysis in LLVM with Type and Data-Flow Co-Analysis 引用了 Goshawk: Hunting Memory Corruptions via Structure-Aware and Object-Centric Memory Operation Synopsis
- Detecting Missed Security Operations Through Differential Checking of Object-based Similar Paths 引用了 PeriScope: An Effective Probing and Fuzzing Framework for the Hardware-OS Boundary
- Detecting Missed Security Operations Through Differential Checking of Object-based Similar Paths 引用了 APISan: Sanitizing API Usages through Semantic Cross-Checking
- Detecting Missed Security Operations Through Differential Checking of Object-based Similar Paths 引用了 Detecting Missing-Check Bugs via Semantic- and Context-Aware Criticalness and Constraints Inferences
- Detecting Missed Security Operations Through Differential Checking of Object-based Similar Paths 引用了 DIFUZE: Interface Aware Fuzzing for Kernel Drivers
引用它的顶会 Paper24
- Goshawk: Hunting Memory Corruptions via Structure-Aware and Object-Centric Memory Operation SynopsisYunlong Lyu, Yi Fang, Yiwei Zhang, Qibin Sun 等S&P 2022 · 26 次引用
- PrIntFuzz: fuzzing Linux drivers via automated virtual device simulationZheyu Ma, Bodong Zhao, Letu Ren, Zheming Li 等ISSTA 2022 · 23 次引用
- Saturn: Host-Gadget Synergistic USB Driver FuzzingYiru Xu, Hao Sun, Jianzhong Liu, Yuheng Shen 等S&P 2024 · 13 次引用
- Improving Indirect-Call Analysis in LLVM with Type and Data-Flow Co-AnalysisDinghao Liu, Shouling Ji, Kangjie Lu, Qinming HeUSENIX Security 2024 · 13 次引用
- Detecting Missed Security Operations Through Differential Checking of Object-based Similar PathsDinghao Liu, Qiushi Wu, Shouling Ji, Kangjie Lu 等CCS 2021 · 11 次引用
它引用的 Paper9
- DIFUZE: Interface Aware Fuzzing for Kernel DriversJake Corina, Aravind Machiry, Christopher Salls, Yan Shoshitaishvili 等CCS 2017 · 195 次引用
- Where Does It Go?: Refining Indirect-Call Targets with Multi-Layer Type AnalysisKangjie Lu, Hong HuCCS 2019 · 142 次引用
- PeriScope: An Effective Probing and Fuzzing Framework for the Hardware-OS BoundaryDokyung Song, Felicitas Hetzelt, Dipanjan Das, Chad Spensky 等NDSS 2019 · 114 次引用
- APISan: Sanitizing API Usages through Semantic Cross-CheckingInsu Yun, Changwoo Min, Xujie Si, Yeongjin Jang 等USENIX Security 2016 · 107 次引用
- Detecting Missing-Check Bugs via Semantic- and Context-Aware Criticalness and Constraints InferencesKangjie Lu, Aditya Pakki, Qiushi WuUSENIX Security 2019 · 97 次引用
相关 Paper
- Exaggerated Error Handling Hurts! An In-Depth Study and Context-Aware DetectionAditya Pakki, Kangjie LuCCS 2020 · 17 次引用
- Error Delayed Is Not Error Handled: Understanding and Fixing Propagated Error-Handling BugsHaoran Liu, Shan-shan Li, Zhouyang Jia, Yuanliang Zhang 等FSE 2025
- Cut to the Chase: An Error-Oriented Approach to Detect Error-Handling BugsHaoran Liu, Zhouyang Jia, Shanshan Li, Yan Lei 等FSE 2024 · 1 次引用
- Detecting API Post-Handling Bugs Using Code and Description in PatchesMiaoqian Lin, Kai Chen, Yang XiaoUSENIX Security 2023
- Automatically Detecting Error Handling Bugs Using Error SpecificationsSuman Jana, Yuan Jochen Kang, Samuel Roth, Baishakhi RayUSENIX Security 2016 · 79 次引用
