Definition
A boot fallback procedure is the rule by which a device’s start-up code chooses which stored version to load when more than one is available, for example the newest version, the previous one and a default built into the firmware. Drawn as an ordered decision procedure, the rule has two parts: a list of eligibility checks that every candidate must pass, and a fixed order in which candidates are tried. The first candidate that passes every check is chosen, and the procedure must also say what happens when none passes.
Where it fits
Main entry: Recovery fallback (§8.29).
The recovery fallback entry explains that a fallback helps only if, when needed, it is present, undamaged, still allowed by the device’s security rules and able to work with the stored data. The entry on boot validation versus arrival authentication §8.30 explains that a check made when an update arrived vouches for the bytes received then, not for the bytes stored now. Read each check in a boot fallback figure as a predicate, a test with a yes-or-no answer about one candidate, and keep the predicates apart: “newest”, “authentic” and “usable” are three different questions.
In an invented case, three candidates are stored: version 9, version 8, and version 1, a default that is part of the firmware image. The device also keeps a floor, the lowest version it may load, stored where an attacker cannot lower it. Refusing versions below the floor is called anti-rollback §8.26, and in this design the rule also covers the default. The checks, in order, are: intact (the stored bytes match a check value recorded with them), authentic (a digital signature §5.14 over the bytes verifies with a key the device trusts), at or above the floor, and compatible (the running code can read the candidate’s data format, its schema). With the floor at 8:
| candidate | intact | authentic | at least 8 | compatible |
|---|---|---|---|---|
| version 9 | yes | yes | yes | no |
| version 8 | yes | yes | yes | yes |
| version 1 | yes | yes | no | yes |
Version 9 fails compatibility, so the procedure moves on, and version 8 passes every check and is loaded. If the floor rises to 9, versions 8 and 1 fail the floor and version 9 still fails compatibility: no candidate is eligible. The procedure must then take a defined action, such as starting in a restricted mode that waits for a new update. Silently loading version 1, which would still run, would break the floor.
The order of checks matters too: the intactness check must come before any check that reads fields from the stored bytes, because the fields of a damaged copy mean nothing.
All data in this entry’s examples are invented.
Limits and common mistakes
Fail open §1.14 means continuing without a protection when its check cannot be passed; fail closed §1.13 means stopping instead. Each term describes one protection, so name it. Loading version 1 when nothing else passes keeps the device in service but drops anti-rollback: it fails open for anti-rollback. Refusing to load keeps anti-rollback but gives up availability §1.10: it fails closed for anti-rollback.
Authentic does not mean usable: a correctly signed candidate can still be unreadable to the running code, need more memory than is free, or behave wrongly once it runs.
The order of candidates is a design choice, and it decides which candidate is chosen when several pass. A common second choice is the last-known-good state §8.25, the version most recently confirmed to work, which need not be the version installed just before the newest one.
A reset and a loss of power are different events. After a software reset, RAM contents can survive if the start-up code does not clear them; after a loss of power, only nonvolatile storage, which keeps its contents without power, still holds data. A fallback rule that counts failed starts of a candidate works after both events only if it keeps the count in nonvolatile storage.
Questions answered
What does boot trust that reception does not?
Boot trusts the device’s own storage: that the bytes and records it reads at start-up are the bytes that were checked earlier and the records the device itself wrote, unchanged since. Reception trusts nothing about the bytes that arrive, and checks them before storing them. When an update arrives, the device verifies a cryptographic tag over the received bytes, for example a digital signature, which shows that a holder of the right key produced exactly those bytes. At start-up the device can check the stored copy again or rely on the earlier check. If it relies on the earlier check, boot trusts three things that reception did not need:
the stored bytes have not changed since they were checked, whether through corruption or through anyone able to write the storage;
the record that says “checked” is bound to exactly those bytes, for example because it holds a cryptographic hash §5.1 of them, a fixed-length fingerprint that boot compares with a fresh hash of the stored bytes, and that record was itself not forged;
the stored security state, such as the trusted keys and the version floor, is intact.
Against accidental corruption, a stored hash suffices. Against an attacker who can write the storage, only a check that needs a key the attacker lacks suffices, such as verifying the signature again, because that attacker can replace both the bytes and their stored hash. A file name, a slot number or an “OK” flag binds the decision to no particular bytes: if the bytes change, the flag stays the same. Both stages also trust the checking code itself, which must start from a root of trust §1.33, a component that must be trusted because nothing earlier checks it, such as start-up code in read-only memory.
Related entries: Boot validation versus arrival authentication (§8.30), Rollback versus anti-rollback (§8.26), Last-known-good state (§8.25), Fail closed (§1.13), Fail open (§1.14), Root of trust (§1.33).