From formal verification to bug-finding in CHERIoT
The Cerise project, initiated almost a decade ago at Aarhus University, aimed to develop formal methods for verifying properties of capability machines, particularly those with non-monotonicity and end-to-end results in the presence of unknown code. Over time, Cerise expanded to model various aspects of capability machines, collaborating with multiple universities.
Initially focusing on control-flow integrity, the research group later broadened their scope to include MMIO, attestation, and instruction sets akin to the CHERIoT Sail model. When the CHERIoT project was announced, Cerise's techniques were applied to the CHERIoT switcher, uncovering two critical bugs: a malicious scheduler's ability to resurrect an exited thread with access to a capability it shouldn't have, and a malicious caller exploiting the stack high watermark register to access a callee's stack frame and private data.
The CHERI/CHERIoT model includes interactions with unknown compartments containing both buggy and malicious code. Reasoning about such code is complex, as it requires accounting for both direct and indirect effects, including recursive access and non-monotonic domain transitions. Cerise uniquely supports reasoning about this challenge.
The Griotte sub-project of Cerise developed a language to succinctly describe what is affected and what is not, addressing both memory safety and no-capture properties. This was achieved through two components: a sound separation logic for verifying known code line by line, and a logical relation in separation logic to over-approximate the effect of unknown code, acting as a universal contract for CHERIoT.
The research began with developing a simplified model of CHERIoT and a mini version of the CHERIoT-RTOS, focusing on compartmentalisation mechanisms and the switcher's cross-compartment call path, mirroring key features of the CHERIoT hardware.
Rewritten by urgent.news; may contain errors — check the original.
Source: cheriot.org