Software sandboxing or software-based fault isolation (SFI) is a lightweight approach to building secure systems out of untrusted components. Mozilla, for example, uses SFI to harden the Firefox browser by sandboxing third-party libraries, and companies like Fastly and Cloudflare use SFI to safely co-locate untrusted tenants on their edge clouds. While there have been significant efforts to optimize and verify SFI enforcement, context switching in SFI systems remains largely unexplored: almost all SFI systems use heavyweight transitions that are not only error-prone but incur significant performance overhead from saving, clearing, and restoring registers when context switching. We identify a set of zero-cost conditions that characterize when sandboxed code has sufficient structured to guarantee security via lightweight zero-cost transitions (simple function calls). We modify the Lucet Wasm compiler and its runtime to use zero-cost transitions, eliminating the undue performance tax on systems that rely on Lucet for sandboxing (e.g., we speed up image and font rendering in Firefox by up to 29.7To remove the Lucet compiler and its correct implementation of the Wasm specification from the trusted computing base, we (1) develop a static binary verifier, VeriZero, which (in seconds) checks that binaries produced by Lucet satisfy our zero-cost conditions, and (2) prove the soundness of VeriZero by developing a logical relation that captures when a compiled Wasm function is semantically well-behaved with respect to our zero-cost conditions. Finally, we show that our model is useful beyond Wasm by describing a new, purpose-built SFI system, SegmentZero32, that uses x86 segmentation and LLVM with mostly off-the-shelf passes to enforce our zero-cost conditions; our prototype performs on-par with the state-of-the-art Native Client SFI system.
翻译:软体沙箱或基于软件的断层隔离(SFI) 是一种轻巧的方法, 用来用不信任的部件来建立安全系统。 例如, Mozilla 使用 SFI 来通过沙箱第三方图书馆使Firefox浏览器硬化Fire浏览器, Fastly 和 Cloudflare 等公司利用SFI 安全地将不信任的租户安置在其边缘云层上。 尽管已经做出了重大努力来优化和核查SFI 的强制执行,但SFI 系统的背景转换基本上仍未探索: 几乎所有SFI 系统都使用超重的、 不仅容易出错的过渡, 而且在环境转换时, 需要大量的业绩管理。 我们确定了一套零成本代码代码的零成本浏览器的零成本浏览器 。 我们用Lucet Wam 汇编器及其运行的运行时间是零成本转换, 用Lucreferro的系统来消除不合理的业绩税 。 我们用Lucretret- frideal在Fox 上快速更新到297.的运行的运行系统 。