MSWasm: Soundly Enforcing Memory-Safe Execution of Unsafe Code
Proceedings of the ACM on Programming Languages · 09.01.2023 · 7 (POPL) · 425-454
DOI: 10.1145/3571208 ↗Kurz gefasst
Fachartikel in der Zeitschrift Proceedings of the ACM on Programming Languages, online erschienen am 11.01.2023. Verfasst von Alexandra E. Michael und 10 weiteren Autor:innen. Die Arbeit wurde bisher 23-mal zitiert (Crossref) und nennt 57 Literaturangaben. Der Volltext ist frei zugänglich (Open Access, CC BY 4.0).
Abstract (Originalsprache)
Most programs compiled to WebAssembly (Wasm) today are written in unsafe languages like C and C++. Unfortunately, memory-unsafe C code remains unsafe when compiled to Wasm—and attackers can exploit buffer overflows and use-after-frees in Wasm almost as easily as they can on native platforms. Memory- Safe WebAssembly (MSWasm) proposes to extend Wasm with language-level memory-safety abstractions to precisely address this problem. In this paper, we build on the original MSWasm position paper to realize this vision. We give a precise and formal semantics of MSWasm, and prove that well-typed MSWasm programs are, by construction, robustly memory safe. To this end, we develop a novel, language-independent memory-safety property based on colored memory locations and pointers. This property also lets us reason about the security guarantees of a formal C-to-MSWasm compiler—and prove that it always produces memory-safe programs (and preserves the semantics of safe programs). We use these formal results to then guide several implementations: Two compilers of MSWasm to native code, and a C-to-MSWasm compiler (that extends Clang). Our MSWasm compilers support different enforcement mechanisms, allowing developers to make security-performance trade-offs according to their needs. Our evaluation shows that on the PolyBenchC suite, the overhead of enforcing memory safety in software ranges from 22% (enforcing spatial safety alone) to 198% (enforcing full memory safety), and 51.7% when using hardware memory capabilities for spatial safety and pointer integrity. More importantly, MSWasm’s design makes it easy to swap between enforcement mechanisms; as fast (especially hardware-based) enforcement techniques become available, MSWasm will be able to take advantage of these advances almost for free.
Zitieren
APA
Michael, A. E., Gollamudi, A., Bosamiya, J., Johnson, E., Denlinger, A., Disselkoen, C., Watt, C., Parno, B., Patrignani, M., Vassena, M., & Stefan, D. (2023). MSWasm: Soundly Enforcing Memory-Safe Execution of Unsafe Code. Proceedings of the ACM on Programming Languages, 7(POPL), 425-454. https://doi.org/10.1145/3571208
Vancouver
Michael AE, Gollamudi A, Bosamiya J, Johnson E, Denlinger A, Disselkoen C, et al. MSWasm: Soundly Enforcing Memory-Safe Execution of Unsafe Code. Proceedings of the ACM on Programming Languages. 2023;7(POPL):425-454. doi:10.1145/3571208
BibTeX
@article{Michael2023,
author = {Michael, Alexandra E. and Gollamudi, Anitha and Bosamiya, Jay and Johnson, Evan and Denlinger, Aidan and Disselkoen, Craig and Watt, Conrad and Parno, Bryan and Patrignani, Marco and Vassena, Marco and Stefan, Deian},
title = {MSWasm: Soundly Enforcing Memory-Safe Execution of Unsafe Code},
journal = {Proceedings of the ACM on Programming Languages},
year = {2023},
volume = {7},
number = {POPL},
pages = {425--454},
doi = {10.1145/3571208}
}
EUVIMED