Dynamic Process Isolation

Martin Schwarzl, Pietro Borrello, Andreas Kogler, Kenton Varda, Thomas Schuster, Daniel Gruss, Michael SchwarzarXiv 2021

TL;DR

This paper introduces "Dynamic Process Isolation," a novel security mechanism for edge computing environments like Cloudflare Workers. It addresses the performance-security trade-off by dynamically isolating suspicious worker scripts, offering the speed of language-level isolation for benign code and the security of process isolation for malicious code, all with minimal overhead.

What Problem Does This Paper Address?

Modern edge computing platforms, aiming for high performance and efficiency, often run multiple tenant workloads within the same process. While this reduces overhead compared to traditional virtualization, it creates a significant security vulnerability: microarchitectural attacks like Spectre can leak data between co-located tenants. Existing solutions either enforce strict process isolation (sacrificing performance) or rely on language-level sandboxing (which is insufficient against Spectre). This paper tackles the challenge of providing robust Spectre attack mitigation in these high-performance, multi-tenant edge environments without crippling performance.

Methods

The core of the proposed solution is Dynamic Process Isolation, which combines a Spectre detection mechanism with dynamic process isolation.

  1. Spectre Detection: The detection relies on hardware performance counters (HPC). Specifically, it monitors the ratio of retired branches to iTLB accesses. The intuition is that Spectre attacks, due to their speculative execution and branch prediction manipulation, exhibit a distinct pattern in these metrics compared to normal workloads. They propose two detection approaches:
  2. PEBS-based: Uses Precise Event-Based Sampling (PEBS) to analyze mispredicted and retired branches, comparing their distribution to a template attack using a Kolmogorov-Smirnov (KS) test.
  3. Normalized HPC: A faster approach that normalizes retired branches by iTLB accesses. This method is more practical for production environments.
  4. Dynamic Process Isolation: When the detection mechanism flags a worker script as suspicious (indicating a potential Spectre attack), the system dynamically isolates that specific worker into its own separate process. This is achieved by forking a new process sandbox and communicating via an RPC protocol. This approach avoids isolating all workers, thus preserving performance for the vast majority of benign workloads. In the worst-case scenario (all workers flagged as suspicious), it degrades to strict process isolation, but with only a small overhead from the detection mechanism.

The paper also details a remote Spectre attack on Cloudflare Workers, demonstrating the vulnerability. This attack uses an amplification technique to magnify timing differences between cache hits and misses, and a remote timing server to measure these differences, achieving a leakage rate of 120 bit/h.

Datasets

Not explicitly discussed in the paper. The authors evaluate their detection mechanism using a set of 128 programs from the Phoronix benchmark suite and 13 Spectre gadgets from Kocher [57]. They also evaluate their approach on a production Cloudflare Workers environment.

Key Insights and Ideas

  • Spectre is a real threat in edge computing: The paper demonstrates a practical Spectre attack against Cloudflare Workers, a widely used edge platform, highlighting that existing language-level isolation is insufficient.
  • Performance vs. Security Trade-off is Addressable: Dynamic Process Isolation offers a compelling middle ground, avoiding the performance penalty of always-on strict isolation while still providing strong security guarantees when needed.
  • Branch Prediction Metrics as Detectors: The ratio of retired branches to iTLB accesses proves to be a surprisingly effective, low-overhead indicator for detecting Spectre attacks.
  • Remote Spectre Attacks are Feasible: The paper shows that even without local high-resolution timers, Spectre attacks can be mounted remotely by leveraging amplification techniques and external timing servers.
  • Dynamic Isolation is Practical: The proposed solution integrates into existing infrastructure with manageable overhead, especially when the false positive rate is low.

Key Results

  • Spectre Attack on Cloudflare Workers: Demonstrated a remote Spectre attack leaking 120 bit/h.
  • Detection Performance:
    • PEBS-based approach: Achieved a false-positive rate of 2.83% with a 2% overhead on a proof-of-concept, but a prohibitive 50% overhead on a production system.
  • Normalized HPC approach: Achieved a negligible 2% performance overhead on production systems.
  • False Positive Rate: With the normalized HPC approach, a threshold of 4096 retired branches per iTLB access yielded an average false-positive rate of 0.61% on production devices.
  • Performance Overhead: The Dynamic Process Isolation mechanism incurs an average overhead of 2% for detection. In the worst case (all workers isolated), it's slightly worse than strict process isolation, but the low false-positive rate makes this unlikely.

Limitations and Future Work

  • False Positives/Negatives: Like most detection mechanisms, the proposed approach is susceptible to false positives and negatives. While the low false-positive rate is manageable, false negatives remain a concern, especially for novel Spectre variants.
  • PEBS Overhead: The PEBS-based detection method, while more precise, incurs a significant performance overhead (50%) on production systems, making it impractical.
  • Kernel Modifications: Improving PEBS performance might require kernel modifications, which are complex and risky in production environments.
  • Spectre Variants: The current detection is primarily tuned for Spectre-PHT. While it shows promise for other variants, further evaluation is needed.
  • Future Work: The authors suggest exploring PEBS-based detection further, investigating optimizations for the dynamic isolation process (e.g., using shared memory for RPC), and adapting the detection for more sophisticated machine learning approaches to further reduce false positives. They also note a bug in the Linux perf implementation related to PEBS timestamps.

Summary updated

BibTeX
@misc{schwarzl2021dynamic,
  author = {Martin Schwarzl and Pietro Borrello and Andreas Kogler and Kenton Varda and Thomas Schuster and Daniel Gruss and Michael Schwarz},
  title = {{Dynamic Process Isolation}},
  year = {2021},
  eprint = {2110.04751},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2110.04751},
}
Figure