Memory safety enforcement using CHERI
Posted: 2022-04-04, 0:32:32
I recently stumbled upon the CHERI project because there is an ongoing effort inside the Rust language to change pointers in order to support its memory model. It can also be supported by other languages such as C/C++ by imposing some restrictions, with the ultimate goal of greatly enhancing memory safety and enabling it to be formally proved, at least as far as I understood it.
https://www.cl.cam.ac.uk/research/security/ctsrd/cheri/
This is the site to the project. It not only provides enhancements for software, but also for hardware as well, which makes it interesting in the context of ForwardCom.
On a basic level, it changes pointers to a structure with double the side of an address word called a capability. Additional fields include permission flags, an object type describing the memory pool it belongs to, and bounds in both directions. There's also an associated validity flag.
New capabilities can only be constructed using existing ones, whereas the new ones permissions can't exceed the ones of the capability that was used to construct it. Deallocations should be able to invalidate any capability pointing to its memory.
Supporting it would probably require substantial changes to the ForwardCom specification, but maybe the memory safety guarantees would be worth it. In any case, I think it is worth some investigation and discussion.
https://www.cl.cam.ac.uk/research/security/ctsrd/cheri/
This is the site to the project. It not only provides enhancements for software, but also for hardware as well, which makes it interesting in the context of ForwardCom.
On a basic level, it changes pointers to a structure with double the side of an address word called a capability. Additional fields include permission flags, an object type describing the memory pool it belongs to, and bounds in both directions. There's also an associated validity flag.
New capabilities can only be constructed using existing ones, whereas the new ones permissions can't exceed the ones of the capability that was used to construct it. Deallocations should be able to invalidate any capability pointing to its memory.
Supporting it would probably require substantial changes to the ForwardCom specification, but maybe the memory safety guarantees would be worth it. In any case, I think it is worth some investigation and discussion.