Lune

ASPLOS2023顶会

Copy-on-Pin: The Missing Piece for Correct Copy-on-Write

David Hildenbrand, Martin Schulz, Nadav Amit

摘要

Operating systems utilize Copy-on-Write (COW) to conserve memory and improve performance. During the last two decades, a series of COW-related bugs - which compromised security, corrupted memory and degraded performance - was found. The majority of these bugs are related to page "pinning", which operating systems employ to access process memory efficiently and to perform direct I/O. Unfortunately, the true cause of these bugs is not well understood, resulting in incomplete bug fixes. We show this by: (1) surveying previously reported pinning-related COW bugs; (2) uncovering new such bugs in Linux, FreeBSD, and NetBSD; and (3) showing that they occur because the COW logic does not consider page pinnings correctly, resulting in incorrect behavior (e.g., I/O of stale data). We then address the underlying problem by deriving when/how shared pages must be copied and under which conditions pinned pages can be shared to maintain correctness. Based on this assessment, we introduce the "Copy-on-Pin (COP)" scheme, an extension of the COW mechanism that handles pinned pages correctly by ensuring pinned pages and shared pages are mutually exclusive. However, we find that a naive implementation of this scheme hampers performance and increases complexity if pages are copied only when strictly necessary. To compensate, we introduce a relaxed-COP design, which does not require precise tracking of page sharing, maintains correctness without increasing complexity, and (while potentially needlessly copying pages in some corner cases) marginally improves performance. Our relaxed-COP solution has been integrated into Linux 5.19.

问 Lune

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

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

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

可以从这些问题问起

Lune 可以查阅

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

获取答案

免费开始,无需绑卡

脉络

  • On-demand-fork: a microsecond fork for memory-intensive and latency-sensitive applications 引用了 Designing New Operating Primitives to Improve Fuzzing Performance
  • WINNIE : Fuzzing Windows Applications with Harness Synthesis and Fast Cloning 引用了 Designing New Operating Primitives to Improve Fuzzing Performance
  • Every Mapping Counts in Large Amounts: Folio Accounting 引用了 On-demand-fork: a microsecond fork for memory-intensive and latency-sensitive applications
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper1

  1. Every Mapping Counts in Large Amounts: Folio AccountingDavid Hildenbrand, Martin Schulz, Nadav AmitUSENIX ATC 2024

它引用的 Paper4

  1. Dedup Est Machina: Memory Deduplication as an Advanced Exploitation VectorErik Bosman, Kaveh Razavi, Herbert Bos, Cristiano GiuffridaS&P 2016 · 252 次引用
  2. Designing New Operating Primitives to Improve Fuzzing PerformanceWen Xu, Sanidhya Kashyap, Changwoo Min, Taesoo KimCCS 2017 · 139 次引用
  3. On-demand-fork: a microsecond fork for memory-intensive and latency-sensitive applicationsKaiyang Zhao, Sishuai Gong, Pedro FonsecaEuroSys 2021 · 25 次引用
  4. WINNIE : Fuzzing Windows Applications with Harness Synthesis and Fast CloningJinho Jung, Stephen Tong, Hong Hu, Jungwon Lim 等NDSS 2021

相关 Paper

  1. Lelantus: Fine-Granularity Copy-On-Write Operations for Secure Non-Volatile MemoriesJian Zhou, Amro Awad, Jun WangISCA 2020 · 7 次引用
  2. Detecting Kernel Refcount Bugs with Two-Dimensional Consistency CheckingXin Tan, Yuan Zhang, Xiyu Yang, Kangjie Lu 等USENIX Security 2021 · 26 次引用
  3. Static Detection of Unsafe DMA Accesses in Device DriversJia-Ju Bai, Tuo Li, Kangjie Lu, Shi-Min HuUSENIX Security 2021 · 28 次引用
  4. How to Copy Memory? Coordinated Asynchronous Copy as a First-Class OS ServiceJingkai He, Yunpeng Dong, Dong Du, Mo Zou 等SOSP 2025 · 2 次引用
  5. Don't shoot down TLB shootdowns!Nadav Amit, Amy Tai, Michael WeiEuroSys 2020 · 32 次引用
黄昏的海面,两侧是细线勾勒的悬崖