TL;DR
This paper introduces Domain Page-Table Isolation (DPTI), a novel mechanism for hardware-enforced security domains on commodity CPUs. DPTI enables faster, more fine-grained syscall filtering and provides enhanced security for SGX enclaves by dynamically manipulating memory protection, all without requiring special hardware extensions.
What Problem Does This Paper Address?
Modern applications increasingly require robust isolation between different security domains within the application itself, not just between separate processes. Existing solutions often rely on specialized hardware, complex software instrumentation, or less-efficient techniques. For instance, Linux's seccomp-bpf is limited in its ability to perform deep argument filtering (like string comparisons) due to Time-of-Check to Time-of-Use (TOCTOU) vulnerabilities. Similarly, while Intel SGX offers strong enclave protection, it has an asymmetric threat model where malicious enclaves can attack the host application. DPTI aims to address these gaps by providing a flexible, efficient, and hardware-enforced isolation mechanism using standard MMU features.
Methods
DPTI introduces two core techniques for dynamic, time-limited memory isolation:
- Memory Freezing (DPTI-Freeze): Temporarily makes a memory page read-only by clearing the "write" permission bit in the page table entry.
- Memory Stashing (DPTI-Stash): Temporarily makes a memory page inaccessible by clearing the "user-space" bit in the page table entry, effectively making it a kernel-only page.
These techniques are applied at security-critical points, such as during syscalls or enclave transitions. DPTI leverages existing MMU page-table management, avoiding the need for new hardware instructions or extensions. It also addresses challenges like alias mappings and multithreading to maintain its security guarantees.
Datasets
Not discussed in the paper. The paper focuses on evaluating its proposed techniques using microbenchmarks and real-world applications.
Key Insights and Ideas
- Commodity Hardware Solution: DPTI's reliance on standard MMU features makes it broadly applicable to existing hardware, unlike solutions requiring specific ISA extensions.
- TOCTOU Mitigation: By temporarily isolating memory regions used by syscall arguments, DPTI effectively prevents TOCTOU vulnerabilities, enabling secure deep argument filtering.
- SGX Asymmetry Addressed: DPTI inverts the SGX threat model, protecting the host application from potentially malicious enclaves by isolating the enclave's view of memory.
- Performance vs. Security Trade-offs: DPTI-Freeze offers read-only protection, allowing enclaves to read host data but not modify it, while DPTI-Stash provides complete inaccessibility, offering stronger confidentiality.
- Overhead is Manageable: Despite dynamic page table manipulation, DPTI achieves competitive or superior performance compared to existing solutions like
seccomp-bpfand SGX confinement methods.
Key Results
- Syscall Filtering: DPTI-based filtering is nearly 10% faster than
seccompfor simple allow/reject filters. For deep argument filtering, DPTI introduces a performance overhead of around 22% foropenatandwritesyscalls, which is significantly lower than the overhead ofseccompin similar scenarios. - SGX Enclave Confinement: DPTI outperforms existing SGX confinement solutions (like SGXJail) by 14.6%-22% for ECALLs and 22% for OCALLs, while requiring no hardware changes.
- Visudo Hardening: DPTI successfully closed a security hole in
visudoby preventing arbitrary editors from opening arbitrary files, demonstrating its practical security benefits.
Limitations and Future Work
- Page Table Flushing Overhead: The primary performance bottleneck identified is the necessity of TLB flushes. Future work could explore using protection keys or other kernel optimizations to mitigate this.
- Alias Mappings: While DPTI handles alias mappings, the overhead can increase with the number of such mappings. The paper notes that alias mappings are rare in real-world applications tested, but a broader analysis is suggested.
- Kernel Integration: The proof-of-concept implementation uses a kernel module. Direct integration into the kernel is suggested for further performance improvements.
- SMAP/SMEP Interaction: The paper briefly mentions that the kernel needs to deactivate SMAP to access syscall parameters, but a deeper analysis of this interaction and its security implications could be explored.
- Broader Application Analysis: While several real-world applications were tested, a more extensive evaluation of alias mapping usage across a wider range of software is proposed.
Summary updated