USENIX Security2024Top-tier venue
SafeFetch: Practical Double-Fetch Protection with Kernel-Fetch Caching
Victor Duta, Mitchel Aloserij, Cristiano Giuffrida
Abstract
Double-fetch bugs (or vulnerabilities) stem from in-kernel system call execution fetching the same user data twice without proper data (re)sanitization, enabling TOCT-TOU attacks and posing a major threat to operating systems security. Existing double-fetch protection systems rely on the MMU to trap on writes to syscall-accessed user pages and provide the kernel with a consistent snapshot of user memory. While this strategy can hinder attacks, it also introduces nontrivial runtime performance overhead due to the cost of trapping/remapping and the coarse (page-granular) write interposition mechanism. In this paper, we propose SafeFetch, a practical solution to protect the kernel from double-fetch bugs. The key intuition is that most system calls fetch small amounts of user data (if at all), hence caching this data in the kernel can be done at a small performance cost. To this end, SafeFetch creates per-syscall caches to persist fetched user data and replay them when they are fetched again within the same syscall. This strategy neutralizes all double-fetch bugs, while eliminating trapping/remapping overheads and relying on efficient byte-granular interposition. Our Linux prototype evaluation shows SafeFetch can provide comprehensive protection with low performance overheads (e.g., 4.4% geomean on LMBench), significantly outperforming state-of-the-art solutions.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 5a55c014-5b06-4eeb-83ca-323a4698a49aCited by top-tier papers3
- IsolatOS: Detecting Double Fetch Bugs in COTS RTOS by Re-enabling Kernel IsolationYingjie Cao, Xiaogang Zhu, Dean Sullivan, Haowei Yang et al.NDSS 2026 · 1 citation
- Dynamic Detection of Vulnerable DMA Race ConditionsBrian Johannesmeyer, Raphael Isemann, Cristiano Giuffrida, Herbert BosCCS 2025
- Static Detection of TOCTOU Bugs Caused by Kernel RacesGui-Dong Han, Jia-Ju Bai, Qiu-Ji Chen, Jiqiang LuUSENIX Security 2026
Builds on7
- Precise and Scalable Detection of Double-Fetch Bugs in OS KernelsMeng Xu, Chenxiong Qian, Kangjie Lu, Michael Backes et al.S&P 2018 · 95 citations
- How Double-Fetch Situations turn into Double-Fetch Vulnerabilities: A Study of Double Fetches in the Linux KernelPengfei Wang, Jens Krinke, Kai Lu, Gen Li et al.USENIX Security 2017 · 66 citations
- Midas: Systematic Kernel TOCTTOU ProtectionAtri Bhattacharyya, Uros Tesic, Mathias PayerUSENIX Security 2022
- SecureCells: A Secure Compartmentalized ArchitectureAtri Bhattacharyya, Florian Hofhammer, Yuanlong Li, Siddharth Gupta et al.S&P 2023
- Silent Bugs Matter: A Study of Compiler-Introduced Security BugsJianhao Xu, Kangjie Lu, Zhengjie Du, Zhu Ding et al.USENIX Security 2023
Related papers
- WarpAttack: Bypassing CFI through Compiler-Introduced Double-FetchesJianhao Xu, Luca Di Bartolomeo, Flavio Toffalini, Bing Mao et al.S&P 2023
- Check It Again: Detecting Lacking-Recheck Bugs in OS KernelsWenwen Wang, Kangjie Lu, Pen-Chung YewCCS 2018 · 49 citations
- Don't shoot down TLB shootdowns!Nadav Amit, Amy Tai, Michael WeiEuroSys 2020 · 32 citations
- Preventing Use-After-Free Attacks with Fast Forward AllocationBrian Wickman, Hong Hu, Insu Yun, Daehee Jang et al.USENIX Security 2021 · 53 citations
- Using Trātṛ to tame Adversarial SynchronizationYuvraj Patel, Chenhao Ye, Akshat Sinha, Abigail Matthews et al.USENIX Security 2022
