AEGIS: Towards Formalized and Practical Memory-Safe Execution of C programs via MSWASM

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Esmaeilsabzali, Shahram, Khalatyan, Arayi, Mo, Zhijun, Venkatanarayanan, Sruthi, Xu, Shengjie
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866915183216033792
author Esmaeilsabzali, Shahram
Khalatyan, Arayi
Mo, Zhijun
Venkatanarayanan, Sruthi
Xu, Shengjie
author_facet Esmaeilsabzali, Shahram
Khalatyan, Arayi
Mo, Zhijun
Venkatanarayanan, Sruthi
Xu, Shengjie
contents Programs written in unsafe languages such as C are prone to memory safety errors, which can lead to program compromises and serious real-world security consequences. Recently, Memory-Safe WebAssembly (MSWASM) is introduced as a general-purpose intermediate bytecode with built-in memory safety semantics. Programs written in C can be compiled into MSWASM to get complete memory safety protection. In this paper, we present our extensions on MSWASM, which improve its semantics and practicality. First, we formalize MSWASM semantics in Coq/Iris, extending it with inter-module interaction, showing that MSWASM provides fine-grained isolation guarantees analogous to WASM's coarse-grained isolation via linear memory. Second, we present Aegis, a system to adopt the memory safety of MSWASM for C programs in an interoperable way. Aegis pipeline generates Checked C source code from MSWASM modules to enforce spatial memory safety. Checked C is a recent binary-compatible extension of C which can provide guaranteed spatial safety. Our design allows Aegis to protect C programs that depend on legacy C libraries with no extra dependency and with low overhead. Aegis pipeline incurs 67% runtime overhead and near-zero memory overhead on PolyBenchC programs compared to native.
format Preprint
id arxiv_https___arxiv_org_abs_2503_03698
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle AEGIS: Towards Formalized and Practical Memory-Safe Execution of C programs via MSWASM
Esmaeilsabzali, Shahram
Khalatyan, Arayi
Mo, Zhijun
Venkatanarayanan, Sruthi
Xu, Shengjie
Programming Languages
D.3.0
Programs written in unsafe languages such as C are prone to memory safety errors, which can lead to program compromises and serious real-world security consequences. Recently, Memory-Safe WebAssembly (MSWASM) is introduced as a general-purpose intermediate bytecode with built-in memory safety semantics. Programs written in C can be compiled into MSWASM to get complete memory safety protection. In this paper, we present our extensions on MSWASM, which improve its semantics and practicality. First, we formalize MSWASM semantics in Coq/Iris, extending it with inter-module interaction, showing that MSWASM provides fine-grained isolation guarantees analogous to WASM's coarse-grained isolation via linear memory. Second, we present Aegis, a system to adopt the memory safety of MSWASM for C programs in an interoperable way. Aegis pipeline generates Checked C source code from MSWASM modules to enforce spatial memory safety. Checked C is a recent binary-compatible extension of C which can provide guaranteed spatial safety. Our design allows Aegis to protect C programs that depend on legacy C libraries with no extra dependency and with low overhead. Aegis pipeline incurs 67% runtime overhead and near-zero memory overhead on PolyBenchC programs compared to native.
title AEGIS: Towards Formalized and Practical Memory-Safe Execution of C programs via MSWASM
topic Programming Languages
D.3.0
url https://arxiv.org/abs/2503.03698