Department of Computer Science and Technology

Technical reports

Efficient linkage-based compartmentalization on CHERI

Dapeng Gao, John Baldwin, Jessica Clarke, Nicholas C. Connolly, Brooks Davis, Franz A. Fuchs, Alfredo Mazzinghi, Daniel Moghimi, Peter Rugg, Domagoj Stolfa, Konrad Witaszczyk, Simon W. Moore, Robert N. M. Watson

26 pages

Abstract

We present an efficient linkage-based model for in-process compartmentalization built on CHERI memory safety. Our techniques enable the fine-grained compartmentalization of the entire UNIX user-space, which can scale to 10K+ compartments on desktop systems. The model’s “push-button” compartmentalization along existing library boundaries regularly hosts 500+ compartments per process for large applications such as Chromium, far exceeding the number of concurrently available protection domains supported by other mechanisms (e.g., up to 16 for Intel MPK). Furthermore, custom policies can divide libraries into even more granular compartments. Of the thousands of C/C++ programs we have tested, only the V8 JavaScript engine required source-level adaptation (<300 lines of changed code concerning garbage collection and JIT compilation) to operate with compartmentalization.

We implement the model for CHERI-extended versions of Armv8-A and RISC-V through support in the compiler toolchain and operating system, demonstrating the benefits of a single-address-space model, such as the smooth delegation of memory between compartments, as well as compartment-aware debugging and visualization. We evaluate using multiple processors, including Arm’s superscalar Morello and, notably, the first commercial CHERI-enabled RISC-V application core—Codasip’s in-order dual-issue X730.

Full text

This report is still under preparation and expected to become available by 15 November 2026.

BibTeX record

@TechReport{UCAM-CL-TR-1010,
  author =	 {Gao, Dapeng and Baldwin, John and Clarke, Jessica and
          	  Connolly, Nicholas C. and Davis, Brooks and Fuchs, Franz A.
          	  and Mazzinghi, Alfredo and Moghimi, Daniel and Rugg, Peter
          	  and Stolfa, Domagoj and Witaszczyk, Konrad and Moore, Simon
          	  W. and Watson, Robert N. M.},
  title = 	 {{Efficient linkage-based compartmentalization on CHERI}},
  institution =  {University of Cambridge, Computer Laboratory},
  address =	 {15 JJ Thomson Avenue, Cambridge CB3 0FD, United Kingdom,
          	  phone +44 1223 763500},
  number = 	 {UCAM-CL-TR-1010}
}