Section 1.30

Fault model

Definition

A fault model is the stated list of failures that a design, and the argument that it is correct, must survive: which parts can fail, in what way, how many at once and how often. Typical entries are a process that stops (crash), a device that loses power and restarts (reset), a write to storage cut off partway (torn write §8.19), stored bits that change at random (corruption), lost messages, and parts that behave arbitrarily or maliciously (Byzantine failure §1.31). A guarantee holds only for failures inside its fault model.

The idea

A device updates a configuration record and must survive power loss at any moment. The designers prove that after any reset the record is either the old one or the new one, and tests that cut the power at thousands of points agree. A reviewer then asks what happens if a stored bit flips a month later, or if someone with a programming cable rewrites the record. The proof has nothing to say: it considered only the states a reset can produce, and a flipped bit or a rewritten record produces others. The question lies outside the fault model; it is not a gap in the proof.

A fault model does for accidents what a threat model §1.2 does for attackers: it fixes the rules, so that “robust” becomes a claim that can be checked. A building rated for earthquakes up to a stated strength is a fair picture: the rating says which shaking the building survives and nothing about floods. The picture stops being accurate in one respect: nature strikes at random, while an attacker can cause a fault deliberately, repeatedly and at the worst moment.

How it works

Dependability terminology separates three words. A fault is the cause, such as a bit flipped by radiation. An error is the wrong internal state it produces, such as a corrupted record. A failure is the moment the service delivered becomes wrong, such as the device applying the corrupted setting. A fault model lists faults; the design must keep them from becoming failures.

A fault model answers four questions.

  1. What can fail: a process, a storage medium, a network link, a clock, the power supply, a whole device.

  2. How it fails, from narrow to broad:

    • crash-stop: the part halts and never acts again; if the other parts can reliably detect the halt, the part is called fail-stop;

    • crash-recovery: the part halts and later restarts, with its working memory (RAM) lost and its persistent storage kept; a reset of a device is this case;

    • omission: the part fails to send or receive some messages;

    • timing: the part answers, but too late;

    • torn write: a write cut off by a crash leaves part of the old and part of the new data;

    • corruption: stored or transmitted bits change at random;

    • Byzantine: the part may do anything at all, including lying and acting maliciously.

  3. How many and how often: one fault or several; one reset, or a second reset during recovery from the first; independent faults, or faults with a common cause, such as one power cut that hits every part at once.

  4. What stays trustworthy: for example, code in read-only memory, a key in protected storage, and any guarantee that the storage medium’s datasheet gives for a single write, such as “an aligned 4-byte write either completes or leaves the old value”.

Worked example

A 4-byte record holds FF FF FF FF, the value of erased flash memory §6.6. The device writes 01 02 03 04 over it, one byte after another, and loses power during the write. Which states the device may find after restarting depends on the fault model.

A recovery rule proved for the atomic model, “if the record is not FF FF FF FF, it holds the new value”, accepts 01 02 FF FF as the new value under the in-order torn model. A 32-bit CRC §4.32 (cyclic redundancy check), a short code computed from the data and stored with it, lets the device check a record and reject it when the data and the CRC no longer match. If random corruption makes all combinations of the 4 record bytes and the 4 CRC bytes equally likely, a corrupted record passes the check with probability 2−322^{-32}, about 1 in 4.3 billion. A torn write is not random corruption: whether a torn record passes is decided by the old and new contents and by which parts of the write completed. That probability therefore does not cover torn records. A design that relies on the CRC to catch torn records must show that every torn record its writes can produce fails the check. A CRC does not stop tampering, because the attacker computes a correct CRC for any value. A MAC (message authentication code §5.7) with a key the attacker lacks stops invented values, but not the restored older record, which carries a valid MAC. Only state that the attacker cannot roll back, such as a monotonic counter §8.28, stops that.

Stated precisely

Describe the system as a set of states with normal transitions, the steps the design takes. A fault model FF adds fault transitions, such as “power is lost now” or “this stored byte takes any value”, together with limits on how many may occur and when. A property is guaranteed under FF if it holds in every run that mixes normal transitions with fault transitions of FF within those limits.

If F1⊆F2F_1 \subseteq F_2, every run allowed by F1F_1 is also allowed by F2F_2. A proof under F2F_2 therefore covers F1F_1, while a proof under F1F_1 says nothing about the extra runs of F2F_2. Reset alone, reset with random corruption, and reset with tampering form such a chain: each adds states that the one before cannot produce. A claim that something good eventually happens also needs a limit on how often faults occur: a device that resets every 1 ms never finishes a write that takes 2 ms.

Limits and common mistakes

A fault model is an assumption about the hardware, not a fact about it. Check it against the datasheet and test it, for example by power-loss injection §8.38, cutting the power at many points during writes.

Fail-stop is an idealization. A failing part often produces wrong outputs before it halts.

Checksums and CRCs detect accidents, not attackers.

Faults can be caused on purpose. Fault injection §10.28 by an attacker, such as a voltage glitch that makes the processor skip an instruction, belongs in the threat model and needs defenses that a reset model does not provide.

An argument for one fault fails under repeated faults: a reset during recovery, or a second torn write, can reach states that the argument never covered.

A claim must name its fault model. “Survives power loss at any point during an update” is a claim that can be tested; “is robust” is not.

Questions answered

Does a reset model also include storage corruption or malicious tampering?

No. A reset model, in which the device loses power and restarts, assumes that every byte the device finished writing is still there unchanged, and that at most the write in progress at the moment of the reset is affected, in a way the model states, such as a write torn at byte boundaries. Storage corruption and malicious tampering each add states that a reset cannot produce, so a proof under the reset model says nothing about them.

Corruption changes bits at random, also in records written long ago; handling it needs a detection code on each record, such as a cyclic redundancy check, and a rule for what to do when the check fails. Tampering lets an attacker choose any content, recompute any checksum and restore an older valid copy; handling it needs a message authentication code with a key the attacker lacks, plus a counter the attacker cannot roll back, and it belongs to the threat model. If either is in scope, extend the fault model and the proof; otherwise state that it is excluded.

Related entries: Failure atomicity (§8.5), Byzantine failure (§1.31), Adversarial composition (§1.24), Torn write (§8.19), Power-loss injection (§8.38), Threat model (§1.2), Checksum versus CRC (§4.32).