[Paper Review] CompartOS: CHERI Compartmentalization for Embedded Systems
CompartOS introduces a lightweight, linkage-based software compartmentalization model for high-end embedded systems using CHERI capability hardware, enabling fine-grained, scalable, and deterministic protection. It achieves 95% faster protection-domain crossing than MPU-based IPC and reduces TCP throughput overhead to 15% vs. 52% for MPU-based systems, while catching 10 out of 13 FreeRTOS-TCP vulnerabilities that MPU models miss.
Existing high-end embedded systems face frequent security attacks. Software compartmentalization is one technique to limit the attacks' effects to the compromised compartment and not the entire system. Unfortunately, the existing state-of-the-art embedded hardware-software solutions do not work well to enforce software compartmentalization for high-end embedded systems. MPUs are not fine-grained and suffer from significant scalability limitations as they can only protect a small and fixed number of memory regions. On the other hand, MMUs suffer from non-determinism and coarse-grained protection. This paper introduces CompartOS as a lightweight linkage-based compartmentalization model for high-end, complex, mainstream embedded systems. CompartOS builds on CHERI, a capability-based hardware architecture, to meet scalability, availability, compatibility, and fine-grained security goals. Microbenchmarks show that CompartOS' protection-domain crossing is 95% faster than MPU-based IPC. We applied the CompartOS model, with low effort, to complex existing systems, including TCP servers and a safety-critical automotive demo. CompartOS not only catches 10 out of 13 FreeRTOS-TCP published vulnerabilities that MPU-based protection (e.g., uVisor) cannot catch but can also recover from them. Further, our TCP throughput evaluations show that our CompartOS prototype is 52% faster than relevant MPU-based compartmentalization models (e.g., ACES), with a 15% overhead compared to an unprotected system. This comes at an FPGA's LUTs overhead of 10.4% to support CHERI for an unprotected baseline RISC-V processor, compared to 7.6% to support MPU, while CHERI only incurs 1.3% of the registers area overhead compared to 2% for MPU.
Motivation & Objective
- Address the lack of scalable, fine-grained, and deterministic hardware-software security for large, complex, real-time embedded systems.
- Overcome the limitations of MPU-based solutions—such as coarse-grained protection and poor scalability—commonly used in mainstream RTOSes.
- Enable compatibility with existing codebases by avoiding source code changes or language migration, preserving real-time determinism.
- Provide a practical, low-overhead solution for securing safety-critical systems like automotive and avionics platforms.
- Demonstrate that CHERI-based compartmentalization can support partial recovery from vulnerabilities, improving system availability.
Proposed method
- Leverages CHERI capability hardware to enforce fine-grained, type-safe memory access and protection boundaries.
- Uses a linkage-based model to compartmentalize existing software components without requiring refactoring or language changes.
- Employs CHERI’s bounds checking and capability-based access control to detect and contain buffer overflows and memory corruption.
- Introduces a custom fault handler that isolates and recovers compromised compartments (e.g., TCP/IP stack) without halting the entire system.
- Uses CHERI’s Global Pointer (CGP) and capability validation to detect and block unauthorized memory accesses in real time.
- Evaluates performance and security using microbenchmarks and real-world systems, including FreeRTOS-TCP and an automotive demo.
Experimental results
Research questions
- RQ1Can CHERI-based compartmentalization provide fine-grained, scalable, and deterministic protection for large, complex embedded systems where MPU-based solutions fail?
- RQ2To what extent can CompartOS maintain source-code compatibility and real-time determinism while enabling automatic vulnerability detection and recovery?
- RQ3How does CompartOS compare to MPU-based models in terms of performance, security coverage, and system availability under exploit conditions?
- RQ4Can CompartOS enable partial recovery from critical vulnerabilities (e.g., in TCP/IP stacks) without system-wide reboot?
- RQ5What is the hardware cost of integrating CHERI for compartmentalization compared to MPU, in terms of LUTs and register area?
Key findings
- CompartOS reduces protection-domain crossing latency by 95% compared to MPU-based IPC, achieving sub-22 microsecond fault handling.
- The system detects and contains 10 out of 13 FreeRTOS-TCP vulnerabilities that MPU-based solutions (e.g., uVisor) fail to catch.
- TCP throughput in CompartOS is 52% faster than MPU-based models (e.g., ACES), with only 15% overhead compared to an unprotected system.
- CompartOS incurs a 10.4% LUT overhead on FPGA to support CHERI, compared to 7.6% for MPU, with only 1.3% register area overhead vs. 2% for MPU.
- A compromised TCP/IP stack can be restarted in 1 second with minimal impact on real-time components, while non-compartmentalized systems require at least 2 seconds and halt all operations.
- The fault handler in CompartOS successfully isolates and recovers from memory corruption without source code changes, maintaining system availability and real-time guarantees.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.