Lune

USENIX Security2023顶会

Place Your Locks Well: Understanding and Detecting Lock Misuse Bugs

Yuandao Cai, Peisen Yao, Chengfeng Ye, Charles Zhang

摘要

Modern multi-threaded software systems commonly leverage locks to prevent concurrency bugs. Nevertheless, due to the complexity of writing the correct concurrent code, using locks itself is often error-prone. In this work, we investigate a general variety of lock misuses. Our characteristic study of existing CVE IDs reveals that lock misuses can inflict concurrency errors and even severe security issues, such as denial-of-service and memory corruption. To alleviate the threats, we present a practical static analysis framework, namely Lockpick, which consists of two core stages to effectively detect misused locks. More specifically, Lockpick first conducts path-sensitive typestate analysis, tracking lock-state transitions and interactions to identify sequential typestate violations. Guided by the preceding results, Lockpick then performs concurrency-aware detection to pinpoint various lock misuse errors, effectively reasoning about the thread interleavings of interest. The results are encouraging—we have used Lockpick to uncover 203 unique and confirmed lock misuses across a broad spectrum of impactful open-source systems, such as OpenSSL, the Linux kernel, PostgreSQL, MariaDB, FFmpeg, Apache HTTPd, and FreeBSD. Three exciting results are that those confirmed lock misuses are long-latent, hiding for 7.4 years on average; in total, 16 CVE IDs have been assigned for the severe errors uncovered; and Lockpick can flag many real bugs missed by the previous tools with significantly fewer false positives.

问 Lune

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

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

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

可以从这些问题问起

Lune 可以查阅

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

获取答案

免费开始,无需绑卡

脉络

  • LR-Miner: Static Race Detection in OS Kernels by Mining Locking Rules 引用了 Razzer: Finding Kernel Race Bugs through Fuzzing
  • LR-Miner: Static Race Detection in OS Kernels by Mining Locking Rules 引用了 Krace: Data Race Fuzzing for Kernel File Systems
  • LR-Miner: Static Race Detection in OS Kernels by Mining Locking Rules 引用了 Precise and Scalable Detection of Double-Fetch Bugs in OS Kernels
  • LR-Miner: Static Race Detection in OS Kernels by Mining Locking Rules 引用了 Detecting Missing-Check Bugs via Semantic- and Context-Aware Criticalness and Constraints Inferences
  • Krace: Data Race Fuzzing for Kernel File Systems 引用了 Razzer: Finding Kernel Race Bugs through Fuzzing
  • Unleashing the Power of Type-Based Call Graph Construction by Using Regional Pointer Information 引用了 Krace: Data Race Fuzzing for Kernel File Systems
  • Unleashing the Power of Type-Based Call Graph Construction by Using Regional Pointer Information 引用了 Precise and Scalable Detection of Double-Fetch Bugs in OS Kernels
  • Detecting Missing-Check Bugs via Semantic- and Context-Aware Criticalness and Constraints Inferences 引用了 Automatically Detecting Error Handling Bugs Using Error Specifications
  • Plankton: Reconciling Binary Code and Debug Information 引用了 Unleashing the Power of Type-Based Call Graph Construction by Using Regional Pointer Information
  • When Threads Meet Interrupts: Effective Static Detection of Interrupt-Based Deadlocks in Linux 引用了 Razzer: Finding Kernel Race Bugs through Fuzzing
  • When Threads Meet Interrupts: Effective Static Detection of Interrupt-Based Deadlocks in Linux 引用了 Krace: Data Race Fuzzing for Kernel File Systems
  • When Threads Meet Interrupts: Effective Static Detection of Interrupt-Based Deadlocks in Linux 引用了 Unleashing the Power of Type-Based Call Graph Construction by Using Regional Pointer Information
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper8

  1. Unleashing the Power of Type-Based Call Graph Construction by Using Regional Pointer InformationYuandao Cai, Yibo Jin, Charles ZhangUSENIX Security 2024 · 16 次引用
  2. Plankton: Reconciling Binary Code and Debug InformationAnshunkang Zhou, Chengfeng Ye, Heqing Huang, Yuandao Cai 等ASPLOS 2024 · 11 次引用
  3. 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 次引用
  4. Towards More Accurate Static Analysis for Taint-Style Bug Detection in Linux KernelHaonan Li, Hang Zhang, Kexin Pei, Zhiyun QianASE 2025 · 5 次引用
  5. When Threads Meet Interrupts: Effective Static Detection of Interrupt-Based Deadlocks in LinuxChengfeng Ye, Yuandao Cai, Charles ZhangUSENIX Security 2024 · 5 次引用

它引用的 Paper19

  1. Razzer: Finding Kernel Race Bugs through FuzzingDae R. Jeong, Kyungtae Kim, Basavesh Shivakumar, Byoungyoung Lee 等S&P 2019 · 202 次引用
  2. Krace: Data Race Fuzzing for Kernel File SystemsMeng Xu, Sanidhya Kashyap, Hanqing Zhao, Taesoo KimS&P 2020 · 131 次引用
  3. Detecting Missing-Check Bugs via Semantic- and Context-Aware Criticalness and Constraints InferencesKangjie Lu, Aditya Pakki, Qiushi WuUSENIX Security 2019 · 97 次引用
  4. Precise and Scalable Detection of Double-Fetch Bugs in OS KernelsMeng Xu, Chenxiong Qian, Kangjie Lu, Michael Backes 等S&P 2018 · 95 次引用
  5. Automatically Detecting Error Handling Bugs Using Error SpecificationsSuman Jana, Yuan Jochen Kang, Samuel Roth, Baishakhi RayUSENIX Security 2016 · 79 次引用

相关 Paper

  1. DLOS: Effective Static Detection of Deadlocks in OS KernelsJia-Ju Bai, Tuo Li, Shi-Min HuUSENIX ATC 2022 · 10 次引用
  2. GoPV: Detecting Blocking Concurrency Bugs Related to Shared-Memory Synchronization in GoWei Song, Xiaofan Xu, Jeff HuangISSTA 2025
  3. An empirical study on the effectiveness of static C code analyzers for vulnerability detectionStephan Lipp, Sebastian Banescu, Alexander PretschnerISSTA 2022 · 99 次引用
  4. Concrat: An Automatic C-to-Rust Lock API Translator for Concurrent ProgramsJaemin Hong, Sukyoung RyuICSE 2023 · 17 次引用
  5. Precise Detection of Kernel Data Races with Probabilistic Lockset AnalysisGabriel Ryan, Abhishek Shah, Dongdong She, Suman JanaS&P 2023
黄昏的海面,两侧是细线勾勒的悬崖