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 \emph{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 \emph{zero-cost conditions} that characterize when sandboxed code has sufficient structured to guarantee security via lightweight \emph{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.7\% and 10\% respectively). To remove the Lucet compiler and its correct implementation of the Wasm specification from the trusted computing base, we (1) develop a \emph{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浏览器, 以及像Sdloadflare这样的公司使用SFI 安全地将不信任的房客放在其边缘云层上。 虽然已经做出了重大努力来优化和核查SFI的强制执行情况,但SFI系统的背景转换基本上仍未进行探索: 几乎所有SFI系统都使用 memph{heavy体重过渡} 这些系统不仅容易出错,而且在环境切换时需要大量业绩管理。 我们确定一套emph{0cloforfox浏览器的运行方式,我们用Srlickr discoals的运行方式,我们用Srickr discorrupil化的运行方式来进行。