Remix.run Logo
▲ saithound an hour ago

You write:

> One of the most interesting things is how Sel4 works -- IIUC they compile to arm64 assembler, and then run verification proofs on that

But that's not how seL4 works. The seL4 proofs are refinement proofs. No assembly is involved, and the verification work is done on the abstract mathematical spec, and the C implementation. Here's how it works:

1. They write a mathematical specification in Isabelle.

2. They prove good security properties about the mathematical specification. They show that a correct implementation of the specification wouls prevent applications running on top of it from modifying data without authorisation (integrity), from interfering with resource access of other applications (availability), and from learning information from other applications without explicit authorisation (confidentiality).

3. They prove (in Isabelle, an interacrive theorem prover) that a Haskell program refines an abstract Isabelle specification, then prove that the C implementation of seL4 refines the Haskell program.

4. They compile the C program using gcc, then prove (using an automated tool) that the machine code was compiled correctly. This works on ARM and RISC-V. Assembly is not involved in the proof, only machine code and C code.

5. Together, the chain of refinements in 3,4 imply that the running binary correctly implements the mathematical specification. Sincw the specification satisfies the good properties, so does the implementation. In other words, the seL4 KERNEL prevents applications running on top of seL4 from modifying data without authorisation (integrity), from interfering with resource access of other applications (availability), and from learning information from other applications without explicit authorisation (confidentiality). Together these security properties enforce the isolation of components running on top of the kernel, allowing critical components to securely run alongside untrusted software.

▲dnautics 34 minutes ago | parent [-]

thanks for the correction! I do maintain that checking the IR is better than checking the code. For C, for example, not having to deal with #defines is by itself enough to make it a reasonable target. In a way I'm glad I got the seL4 methodology wrong.