Cerise: Program Verification on a Capability Machine in the Presence of Untrusted Code


Aïna Linn Georges, Armaël Guéneau, Thomas Van Strydonck, Amin Timany, Alix Trieu, Dominique Devriese, and Lars Birkedal: Cerise: Program Verification on a Capability Machine in the Presence of Untrusted Code. In JACM, December 2023. https://doi.org/10.1145/3623510
Journal Paper
Keywords: capability machines, capability safety, universal contracts, program logic, separation logic, CHERI
Abstract.

A capability machine is a type of CPU allowing fine-grained privilege separation using capabilities, machine words that represent certain kinds of authority. We present a mathematical model and accompanying proof methods that can be used for formal verification of functional correctness of programs running on a capability machine, even when they invoke and are invoked by unknown (and possibly malicious) code. We use a program logic called Cerise for reasoning about known code, and an associated logical relation, for reasoning about unknown code. The logical relation formally captures the capability safety guarantees provided by the capability machine. The Cerise program logic, logical relation, and all the examples considered in the paper have been mechanized using the Iris program logic framework in the Coq proof assistant.

The methodology we present underlies recent work of the authors on formal reasoning about capability machines [Georges et al. 2021; Skorstengaard et al. 2019a; Van Strydonck et al. 2021], but was left somewhat implicit in those publications. In this paper we present a pedagogical introduction to the methodology, in a simpler setting (no exotic capabilities), and starting from minimal examples. We work our way up to new results about a heap-based calling convention and implementations of sophisticated object-capability patterns of the kind previously studied for high-level languages with object-capabilities, demonstrating that the methodology scales to such reasoning.

The bibtex source for this publication:
@article{10.1145/3623510,
 author = {Georges, A\"{\i}na Linn and Gu\'{e}neau, Arma\"{e}l and Van Strydonck, Thomas and Timany, Amin and Trieu, Alix and Devriese, Dominique and Birkedal, Lars},
 title = {Cerise: Program Verification on a Capability Machine in the Presence of Untrusted Code},
 year = {2023},
 publisher = {Association for Computing Machinery},
 address = {New York, NY, USA},
 issn = {0004-5411},
 url = {https://doi.org/10.1145/3623510},
 doi = {10.1145/3623510},
 abstract = {A capability machine is a type of CPU allowing fine-grained privilege separation using capabilities, machine words that represent certain kinds of authority. We present a mathematical model and accompanying proof methods that can be used for formal verification of functional correctness of programs running on a capability machine, even when they invoke and are invoked by unknown (and possibly malicious) code. We use a program logic called Cerise for reasoning about known code, and an associated logical relation, for reasoning about unknown code. The logical relation formally captures the capability safety guarantees provided by the capability machine. The Cerise program logic, logical relation, and all the examples considered in the paper have been mechanized using the Iris program logic framework in the Coq proof assistant. The methodology we present underlies recent work of the authors on formal reasoning about capability machines [15, 33, 37], but was left somewhat implicit in those publications. In this paper we present a pedagogical introduction to the methodology, in a simpler setting (no exotic capabilities), and starting from minimal examples. We work our way up to new results about a heap-based calling convention and implementations of sophisticated object-capability patterns of the kind previously studied for high-level languages with object-capabilities, demonstrating that the methodology scales to such reasoning.},
 note = {Just Accepted},
 journal = {J. ACM},
 month = {sep},
 keywords = {capability machines, capability safety, universal contracts, program logic, separation logic, CHERI}
}