Enforces strict one-way information flow between HIGH and LOW security domains through a trusted intermediary. The diode applies policy checks and audit logging—no data ever flows backwards. This is the canonical Fiducia example.
Guarantee One-way Data Flow
===========================
+-----------+ high_to_diode +-------------+ diode_to_low +-----------+
| domain | ------ ch1 -------> | data | ------ ch2 ------> | domain |
| HIGH | | diode | | LOW |
| pri = 100 | | pri = 200 | | pri = 100 |
+-----------+ +-------------+ +-----------+
(TRUSTED)
No shared memory or channel between domain_high and domain_low.
All information must pass through the trusted data_diode.
The data diode is currently implemented as three C protection domains running on seL4 Microkit. The system description XML defines the architecture, and seL4 capabilities enforce the isolation.
<!-- Shared memory: domain_high writes, data_diode reads --> <memory_region name="high_to_diode" size="0x1_000" /> <memory_region name="diode_to_low" size="0x1_000" /> <protection_domain name="domain_high" priority="100"> <program_image path="domain_high.elf" /> <map mr="high_to_diode" vaddr="0x4_000_000" perms="rw" /> </protection_domain> <protection_domain name="data_diode" priority="200"> <program_image path="data_diode.elf" /> <map mr="high_to_diode" vaddr="0x4_000_000" perms="rw" /> <map mr="diode_to_low" vaddr="0x5_000_000" perms="rw" /> </protection_domain> <protection_domain name="domain_low" priority="100"> <program_image path="domain_low.elf" /> <map mr="diode_to_low" vaddr="0x4_000_000" perms="rw" /> </protection_domain> <!-- Channels: HIGH -> diode -> LOW --> <channel> <end pd="domain_high" id="1" /> <end pd="data_diode" id="1" /> </channel> <channel> <end pd="data_diode" id="2" /> <end pd="domain_low" id="1" /> </channel>
void notified(microkit_channel ch) { if (ch == CH_HIGH) { int len = diode_buf_read(in_buf, msg, 255); /* Apply policy check */ if (!policy_check(msg, len)) { microkit_dbg_puts("[DIODE] BLOCKED by policy!\n"); return; } /* Forward to low side (the one-way transfer) */ diode_buf_write(out_buf, msg, len); microkit_notify(CH_LOW); } /* We deliberately ignore any notification from CH_LOW. * domain_low has no channel carrying data back to HIGH. */ }
In Fiducia the diode is a system description plus one program per protection domain. Below are the system and the forwarder dd, as they stand in the fic repository's demo/datadiode; the two NIC drivers are on the homepage. fire build also emits a UPPAAL model of the system for fire verify.
// Data diode: eth_outer → dd → eth_inner, one-way Low → High. // A frame crosses the diode by copy, as the channels' value; `data` holds // a virtio-net buffer (`VIRTIO_NET_BUF_SIZE`). struct Frame { len: uint16; data: uint8[2048]; } // The channels' rings, mapped into both endpoints of their channel. Low MemoryRegion eth_outer_output(0x200000, 0x200000); High MemoryRegion eth_inner_input(0x200000, 0x200000); // One 4 KiB page of QEMU virt's virtio-mmio slots 24..31, where both NICs // sit; each eth PD binds a different device in it. MemoryRegion virtio_window(0x1000, 0x1000, 0xa003000); // Virtio rings + buffers; physically contiguous, paddr patched by the tool. Low MemoryRegion outer_dma(0x200000, 0x200000); High MemoryRegion inner_dma(0x200000, 0x200000); // IRQ = 48 + mmio slot. QEMU puts the first -device in slot 31 (IRQ 79), // the second in slot 30 (IRQ 78). ProtectionDomain eth_outer(99, 79); ProtectionDomain dd(150); ProtectionDomain eth_inner(199, 78); Chan o2d = eth_outer --> dd via eth_outer_output<Frame>; Chan d2i = dd --> eth_inner via eth_inner_input<Frame>; System = eth_outer ||| dd ||| eth_inner;
// Forwards frames one way, o2d -> d2i. A full d2i loses the frame: the Low // side is never back-pressured. @bind(microkit.init) proc Init() { ready -> Skip; } @bind(microkit.notified) proc Notified() { o2d?f -> forward -> d2i!f -> Notified(); } evt ready: dbg("diode transport ready"); evt forward: dbg("pass o2d -> d2i");
What fic checks:
each channel's ring is mapped into its two endpoints and nowhere else; a High region is never mapped at Low, so data cannot flow from High to Low through a mapping; every channel is one-way (-->) and the channel graph has no cycle (WF2), so no path leads back from eth_inner to eth_outer; and each Notified handler starts with a receive. Labels are checked on mappings, not on values: fic decides where data can go, while what the imported C does to it is the C code's job. Information-flow and well-formedness checking are at an initial stage, still under research.
fic --check. The tutorial builds this diode step by step; install fic or read the language reference.