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

David Hildenbrand, Martin Schulz, Nadav Amit

Publikation: Beitrag in Buch/Bericht/KonferenzbandKonferenzbeitragBegutachtung

1 Zitat (Scopus)

Abstract

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.

OriginalspracheEnglisch
TitelASPLOS 2023 - Proceedings of the 28th ACM International Conference on Architectural Support for Programming Languages and Operating Systems
Redakteure/-innenTor M. Aamodt, Natalie Enright Jerger, Michael Swift
Herausgeber (Verlag)Association for Computing Machinery
Seiten176-191
Seitenumfang16
ISBN (elektronisch)9781450399166
DOIs
PublikationsstatusVeröffentlicht - 27 Jan. 2023
Veranstaltung28th ACM International Conference on Architectural Support for Programming Languages and Operating Systems, ASPLOS 2023 - Vancouver, Kanada
Dauer: 25 März 202329 März 2023

Publikationsreihe

NameInternational Conference on Architectural Support for Programming Languages and Operating Systems - ASPLOS
Band2

Konferenz

Konferenz28th ACM International Conference on Architectural Support for Programming Languages and Operating Systems, ASPLOS 2023
Land/GebietKanada
OrtVancouver
Zeitraum25/03/2329/03/23

Fingerprint

Untersuchen Sie die Forschungsthemen von „Copy-on-Pin: The Missing Piece for Correct Copy-on-Write“. Zusammen bilden sie einen einzigartigen Fingerprint.

Dieses zitieren