Prior work on Linux adaptation

Morello Linux contains a hybrid Linux kernel (not purecap) which supports running and building simple user space applications in purecap mode using a new CHERI-aware ABI called PCuABI. Two software stacks are supported; BusyBox and Debian. However, Debian still runs in vanilla AArch64 mode, but new simple programs can be built in purecap mode:

Many (but not all) Linux-based user space environments depend on GCC for compilation. Arm has developed an initial Morello GCC adaptation believed to be sufficient to compile glibc. However, in their Morello Linux work, they have been using musl in order to bootstrap a user environment even without GCC support. It is not clear how mature the GCC work is, and unlike Morello LLVM, ongoing development and maintenance plans are unclear. Unless a pure LLVM-based compilation of a complete glibc-based Linux distribution can be achieved in the medium term, pushing forward Morello GCC support (and generalizing it to be CHERI GCC support) will be important:

The MMU-less CHERI-RISC-V Linux port is entirely purecap; both the kernel and userspace. The userspace stack includes a simple CHERI-aware run-time linker, uclibc-ng, and BusyBox, all built in purecap mode. It does support an initial implementation of the CompartOS compartmentalisation model which could isolate device drivers built as kernel modules, and user ELF programs built in FDPIC ELF format. This builds with the CHERI-LLVM toolchain without the use of GCC:

There is also work by Huawei on a CHERI-enabled Linux, which they have recently published a workshop paper on. For both serious policy and technical reasons, this is not a suitable input to the CHERI Linux project beyond a simple proof-of-concept demonstration. In particular, it appears that there is frequent rederivation of capabilities from integer pointers without suitable boundsetting throughout the kernel and userspace, such as capability derivation and bounding for mmap being performed within the userspace wrapper, effectively leading to referential and spatial safety protections being ineffectual. However, we include these references for awareness purposes: