Cage: Hardware-Accelerated Safe WebAssembly

Martin Fink, Dimitrios Stavrakakis, Dennis Sprokholt, Soham Chakraborty, Jan-Erik Ekberg, Pramod Bhatotia
{"title":"Cage: Hardware-Accelerated Safe WebAssembly","authors":"Martin Fink, Dimitrios Stavrakakis, Dennis Sprokholt, Soham Chakraborty, Jan-Erik Ekberg, Pramod Bhatotia","doi":"arxiv-2408.11456","DOIUrl":null,"url":null,"abstract":"WebAssembly (WASM) is an immensely versatile and increasingly popular\ncompilation target. It executes applications written in several languages\n(e.g., C/C++) with near-native performance in various domains (e.g., mobile,\nedge, cloud). Despite WASM's sandboxing feature, which isolates applications\nfrom other instances and the host platform, WASM does not inherently provide\nany memory safety guarantees for applications written in low-level, unsafe\nlanguages. To this end, we propose Cage, a hardware-accelerated toolchain for WASM that\nsupports unmodified applications compiled to WASM and utilizes diverse Arm\nhardware features aiming to enrich the memory safety properties of WASM.\nPrecisely, Cage leverages Arm's Memory Tagging Extension (MTE) to (i)~provide\nspatial and temporal memory safety for heap and stack allocations and\n(ii)~improve the performance of WASM's sandboxing mechanism. Cage further\nemploys Arm's Pointer Authentication (PAC) to prevent leaked pointers from\nbeing reused by other WASM instances, thus enhancing WASM's security\nproperties. We implement our system based on 64-bit WASM. We provide a WASM compiler and\nruntime with support for Arm's MTE and PAC. On top of that, Cage's LLVM-based\ncompiler toolchain transforms unmodified applications to provide spatial and\ntemporal memory safety for stack and heap allocations and prevent function\npointer reuse. Our evaluation on real hardware shows that Cage incurs minimal\nruntime ($<5.8\\,\\%$) and memory ($<3.7\\,\\%$) overheads and can improve the\nperformance of WASM's sandboxing mechanism, achieving a speedup of over\n$5.1\\,\\%$, while offering efficient memory safety guarantees.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":null,"pages":null},"PeriodicalIF":0.0000,"publicationDate":"2024-08-21","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"arXiv - CS - Programming Languages","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/arxiv-2408.11456","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

Abstract

WebAssembly (WASM) is an immensely versatile and increasingly popular compilation target. It executes applications written in several languages (e.g., C/C++) with near-native performance in various domains (e.g., mobile, edge, cloud). Despite WASM's sandboxing feature, which isolates applications from other instances and the host platform, WASM does not inherently provide any memory safety guarantees for applications written in low-level, unsafe languages. To this end, we propose Cage, a hardware-accelerated toolchain for WASM that supports unmodified applications compiled to WASM and utilizes diverse Arm hardware features aiming to enrich the memory safety properties of WASM. Precisely, Cage leverages Arm's Memory Tagging Extension (MTE) to (i)~provide spatial and temporal memory safety for heap and stack allocations and (ii)~improve the performance of WASM's sandboxing mechanism. Cage further employs Arm's Pointer Authentication (PAC) to prevent leaked pointers from being reused by other WASM instances, thus enhancing WASM's security properties. We implement our system based on 64-bit WASM. We provide a WASM compiler and runtime with support for Arm's MTE and PAC. On top of that, Cage's LLVM-based compiler toolchain transforms unmodified applications to provide spatial and temporal memory safety for stack and heap allocations and prevent function pointer reuse. Our evaluation on real hardware shows that Cage incurs minimal runtime ($<5.8\,\%$) and memory ($<3.7\,\%$) overheads and can improve the performance of WASM's sandboxing mechanism, achieving a speedup of over $5.1\,\%$, while offering efficient memory safety guarantees.
查看原文
分享 分享
微信好友 朋友圈 QQ好友 复制链接
本刊更多论文
Cage:硬件加速的安全 WebAssembly
WebAssembly (WASM) 是一种用途广泛、日益流行的编译目标。它可以在各种领域(如移动、边缘、云)以接近原生的性能执行以多种语言(如 C/C++)编写的应用程序。尽管 WASM 具有沙箱功能,可将应用程序与其他实例和主机平台隔离,但 WASM 本身并不能为使用低级、不安全语言编写的应用程序提供任何内存安全保证。准确地说,Cage 利用 Arm 的内存标记扩展 (MTE) (i)~ 为堆和栈分配提供空间和时间内存安全,(ii)~ 提高 WASM 沙箱机制的性能。Cage 还采用了 Arm 的指针验证(PAC)技术,防止泄漏的指针被其他 WASM 实例重用,从而增强了 WASM 的安全性能。我们的系统基于 64 位 WASM 实现。我们提供了支持 Arm 的 MTE 和 PAC 的 WASM 编译器和运行时。在此基础上,Cage 基于 LLVM 的编译器工具链对未修改的应用程序进行转换,为堆栈和堆分配提供空间和时间内存安全性,并防止函数指针重复使用。我们在真实硬件上进行的评估表明,Cage产生的运行时间(小于5.8美元)和内存(小于3.7美元)开销极小,而且可以提高WASM沙箱机制的性能,实现了超过5.1美元的提速,同时提供了高效的内存安全保证。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 去求助
来源期刊
自引率
0.00%
发文量
0
期刊最新文献
Repr Types: One Abstraction to Rule Them All $μλεδ$-Calculus: A Self Optimizing Language that Seems to Exhibit Paradoxical Transfinite Cognitive Capabilities Expressing and Analyzing Quantum Algorithms with Qualtran Conversational Concurrency The MLIR Transform Dialect. Your compiler is more powerful than you think
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
现在去查看 取消
×
提示
确定
0
微信
客服QQ
Book学术公众号 扫码关注我们
反馈
×
意见反馈
请填写您的意见或建议
请填写您的手机或邮箱
已复制链接
已复制链接
快去分享给好友吧!
我知道了
×
扫码分享
扫码分享
Book学术官方微信
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术
文献互助 智能选刊 最新文献 互助须知 联系我们:info@booksci.cn
Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。
Copyright © 2023 Book学术 All rights reserved.
ghs 京公网安备 11010802042870号 京ICP备2023020795号-1