Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Information Flow

Memory regions and the mappings that expose them carry a security label, Low or High, on the two-point lattice Low ≤ High. fic checks one rule over them.

A placeholder. Information-flow checking is at an initial stage, still under research. The rule below is what fic checks today, not a guarantee that High data cannot reach Low: flows through expressions, channels and foreign code are not checked.

A mapping’s label must be at least its memory region’s.

A High region is therefore never read through a Low mapping: High data cannot reach a context that is allowed to see only Low.

// .fis
High MemoryRegion secret(0x1000);
Low  MemoryRegion open(0x1000);

// .fi
High Mapping a(secret, "r");     // accepted: label matches
High Mapping b(open, "rw");      // accepted: upward, Low data seen as High
Low  Mapping c(open, "r");       // accepted
Low  Mapping d(secret, "r");     // rejected: a High region through a Low mapping
error: information flow violation: High memory region 'secret' is
accessed through Low mapping 'd'
 --> p.fi:1:1
  | Low Mapping d(secret, "r");

An unlabelled region or mapping is Low. The check reports one error per offending mapping, at the mapping, in the .fi that declares it.

What the labels do and do not cover

  • Labels sit on regions and mappings. A protection domain carries no label of its own: what a PD can see is exactly what it maps.
  • A channel buffer’s mapping takes its region’s label, so only a program’s own Mapping can violate the rule.
  • The check is on mappings only. It does not follow values between variables or across channels, and a channel carries no label.

The data diode

The data-diode demo labels the ring its outer side writes Low and the ring its inner side reads High, with one forwarding PD between them:

Low  MemoryRegion eth_outer_output(0x200000, 0x200000);
High MemoryRegion eth_inner_input(0x200000, 0x200000);

Chan o2d = eth_outer --> dd via eth_outer_output<Slot>;
Chan d2i = dd --> eth_inner via eth_inner_input<Slot>;

Frames enter on the Low side and leave on the High side. The rule keeps the labelling honest: the High ring can never be mapped with a Low label, by any program. It does not by itself make the diode one-way. That direction is the declared topology (-->, outer to inner, and no channel back), which fic --emit=dot draws and the WF2 check warns of a cycle in, but which the information-flow check does not inspect.

fic --check runs this check after typing and the well-formedness checks, WF2 excepted, which runs after it.