This directory contains an efficient runtime environment for Fuchsia components that has been verified to have certain correctness properties against a formal model of the aarch64 Instruction Set Architecture (ISA) and of the Zircon system interface.
These programs are more efficient because they do not require many of the normal abstractions and security mitigations. For example, some production programs can run in a single page of writable memory because we can prove precise bounds on their memory usage. The programs do not require a shadow call stack because we prove both backward- and forward-edge control-flow integrity, including that return addresses are never overwritten and indirect calls target only verified static receivers. The programs do not require separate processes or address spaces for isolation because we prove that all memory accesses are in-bounds, that the programs never panic, and that the programs do not interfere with each other.
These programs are written in Rust and execute without a dynamic loader and without a C runtime library. Instead, the VX runtime bootstraps from the initial machine state provided by Zircon for a process into an operational Fuchsia component. These components integrate into the Fuchsia system in the same way as other components. They use and provide component framework capabilities using the same FIDL interfaces as any other component.
The runtime is structured similarly to other Fuchsia runtimes. The vx_zx crate provides ergonomic Rust wrappers for Zircon concepts, such as handles and channels. From there, the runtime builds up the FIDL wire format, an async reactor, FIDL bindings, a VFS, and a component runtime in a similar structure to normal Rust programs.
The runtime has a backend for the FIDL compiler, fidlgen_curry, which produces correctness proofs along with its FIDL bindings. Its FIDL-IR-to-schema lowering and layout checks are proved sound against the FIDL wire format. The code generator itself remains untrusted: alongside the generated Rust bindings, it emits Lean proofs that VX checks directly against the compiled aarch64 object code linked into the final binary.
Verification begins with a model of the operational semantics of the aarch64 ISA and the Zircon system interface, including the initial machine state for a Zircon process. From this starting point, VX proves end-to-end properties of the ELF binaries loaded into this initial state. The Rust source code and the Rust compiler are untrusted. Although not necessary for security, unsafe Rust code is encapsulated in low-level crates, making the source code easier to understand and letting the Rust compiler, as well as developers and agents, catch mistakes earlier in the engineering pipeline.
Many functions in VX source code are marked #[curry::verified], which instructs the compiler not to inline the function. These functions have an associated proof that they provide certain semantics. VX uses these proofs to prove that their callers provide certain semantics. In this way, VX builds up end-to-end proofs about the properties of entire Fuchsia components starting from the initial state of a Zircon process.
The verification is based on a specification of the aarch64 ISA from AlphaProof Code and a specification of the Zircon system interface that we have created ourselves. The Zircon specification has been cross-checked against Zircon's kernel source, zx.fidl.json, real arm64 libzircon.so binaries, and live emulator runs, and additional work is ongoing to improve the Zircon specification.
We have proved the following properties of Fuchsia components using this approach:
svc instructions outside the vDSO.fidlgen_curry validators are proved to accept an incoming message if and only if it strictly obeys the FIDL wire specification—transactional headers, UTF-8 validity, zero-padding bytes, vector/string bounds, table/union envelopes, handle types/rights, and strict enum/bits discriminants.txid and protocol-specific rules, while malformed client messages cleanly close that client’s channel with no reply.zx_port_wait delivers a packet for an active slot, the executor reaches its receiver in a small constant number of instructions, and handling or tearing down a malformed client takes strictly bounded work, preventing one bad client from hanging or starving others.These isolation and resource-bound theorems let us safely pack multiple small components into a single process to reduce per-process memory overhead, including from Zircon state associated with the process.
We can prove component-specific properties, including security and functional invariants. For kernel-args-forwarder, we prove:
"fuchsia."-prefixed keys into the exported dictionary.kernel.serial UART configuration strings; "fuchsia.kernel.serial" is strictly RFC-0120-persisted as a boolean.fuchsia.boot/Arguments or mutating Capabilities calls can ever occur, and every DictionaryRouter.Route response serves a duplicate of the immutable boot dictionary.