interplane.Get Omega
Read in your language

aienux

Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.

Brought by drakestapleton

branch main Branches Tags History

aienux / docs / native / PI5-4-UNLOCK-RUNS.md

106 lines · 6749 bytes Raw Blame History Rendered
1# PI5-4 unlock runs on the Raspberry Pi 5 (qualification evidence)
2
3Tier: PI5-UNLOCK-QUALIFICATION. Image: `make pi5-unlock-card` at commit 55f6cc0130d2932263ef0baece5a89c88a99c739
4(BOOTAA64.EFI sha256 8936579f86eb367fb14fef725bc363e647d2ee46b914a7b57397fa3741f3e10a). The recovery secret is a
5THROWAWAY (32 random bytes from /dev/urandom, never committed, never printed); the request file
6\EFI\AIENOS\UNLOCK.REQ was placed on the card by `pi5-run.sh UNLOCK_REQ=...` and zeroed, deleted and checked
7absent after each run (`unlock_req_deleted_verified`). Not a production Store: no TPM (Slot 0), the secret came
8from the card. Logs: `~/workspace/pi5-runs/<tag>/kernel.log` on the Spark (not committed).
9
10Before run A the AIENOS partition (/dev/mmcblk0p2 on the hub, 8388608 sectors, not mounted) held a TEST-tier Store.
11Its first 48 sectors were zeroed and read back as zeros (`head_zeroed_readback_ok`), so the new Store is
12production-class from its first byte and never reuses TEST content.
13
14## Run A, pi5-unlock-a: first-time setup with secret S
15
16```
17unlock_req: found a well-formed request file (QUALIFICATION ONLY, throwaway secret); secret not printed
18unlock_source: card request file (QUALIFICATION ONLY, throwaway secret)
19store: identity class=1 (production); anchor lba=0 store lba=32 units=1048563
20store: blank disk (all-zero anchor + Store head): formatted production store
21store: key source=recovery-keyslot genesis=1 (K_vol source: the Slot 1 recovery descriptor; TPM Slot 0 BLOCKED_HARDWARE; no rotation)
22store: opened generation=1 boot_count=0 prev_commit=none anchor=valid-resume
23store: committed generation=2 boot_count=1
24store: security manifest sequence=1 generation=2 keyslot=bound previous=genesis
25store: limit: anchor shares this disk, so a whole-disk rollback is not detectable (needs TPM NV or another external counter)
26stage store: ok
27```
28
29Result: blank Store formatted as a PRODUCTION-class Store, KeySlotManifest bound, generation 1 to 2, boot_count 1.
30
31## Run B, pi5-unlock-b: reboot, same secret S
32
33```
34unlock_req: found a well-formed request file (QUALIFICATION ONLY, throwaway secret); secret not printed
35unlock_source: card request file (QUALIFICATION ONLY, throwaway secret)
36store: identity class=1 (production); anchor lba=0 store lba=32 units=1048563
37store: key source=recovery-keyslot genesis=0 (K_vol source: the Slot 1 recovery descriptor; TPM Slot 0 BLOCKED_HARDWARE; no rotation)
38store: opened generation=2 boot_count=1 prev_commit=55f6cc0130d2932263ef0baece5a89c88a99c739 anchor=valid-resume
39store: committed generation=3 boot_count=2
40store: security manifest sequence=2 generation=3 keyslot=bound previous=linked
41store: limit: anchor shares this disk, so a whole-disk rollback is not detectable (needs TPM NV or another external counter)
42stage store: ok
43```
44
45Result: the Store reopens through the Slot 1 recovery path, no reformat, generation 2 to 3, boot_count 2, the
46SecurityManifest sequence advances to 2 and links the first.
47
48## How "nothing written" was checked (cut 4)
49
50After each refused run, the hub (Linux, partition not mounted) read the Store view of the AIENOS partition (sectors
510 to 8388543, so the 64-sector run marker at the end is excluded because it changes every run) and took its SHA-256.
52
53- H0, taken after Run B and before Run C: 7954edfc924ac4c20d3599757149b81b9497a110757f6ea83ef30bc4b94a9943
54- H1, taken after Run C: 7954edfc924ac4c20d3599757149b81b9497a110757f6ea83ef30bc4b94a9943 (equal to H0)
55
56## Run C, pi5-unlock-c: wrong secret W (last byte differs from S)
57
58```
59unlock_req: found a well-formed request file (QUALIFICATION ONLY, throwaway secret); secret not printed
60unlock_source: card request file (QUALIFICATION ONLY, throwaway secret)
61store: identity class=1 (production); anchor lba=0 store lba=32 units=1048563
62store: key source=recovery-keyslot genesis=0 (K_vol source: the Slot 1 recovery descriptor; TPM Slot 0 BLOCKED_HARDWARE; no rotation)
63store: REFUSED proof=keyed step="recovery secret rejected (K_vol unwrap tag failed); disk not opened" rc=-2004 (RecoverySecretRejected); disk left as found, not reformatted
64stage store: FAIL rc=-2004
65```
66
67Result: refused, and the Store view hash after the run equals the hash before (H0 = H1), so nothing was written.
68
69## Run D, pi5-unlock-d: one byte of the KeySlotManifest flipped, correct secret S
70
71The locator (`ck_pi5_store_locate`, run on a copy of the partition) put the KeySlotManifest at Store unit 6, partition
72sector 80, byte offset 40960, 640 bytes. The wrapped K_vol of the recovery slot is at byte offset 41272. One byte there
73was XOR-ed with 0xFF (0x8b to 0x74) on the card by a whole-sector read-modify-write, read back, and checked to differ
74from the original in exactly one byte.
75
76```
77unlock_source: card request file (QUALIFICATION ONLY, throwaway secret)
78store: identity class=1 (production); anchor lba=0 store lba=32 units=1048563
79store: key source=recovery-keyslot genesis=0 (K_vol source: the Slot 1 recovery descriptor; TPM Slot 0 BLOCKED_HARDWARE; no rotation)
80store: REFUSED proof=keyed step="no KeySlotManifest on a non-blank disk" rc=-105 (MountError::CorruptRecoveryRequired); disk left as found, not reformatted
81stage store: FAIL rc=-105
82```
83
84Result: refused with CorruptRecoveryRequired, no reformat. After the run, a byte-for-byte comparison of the Store view
85against the pre-flip copy showed exactly one differing byte, the flipped one (hash after Run D 37d47b09...a85791), so the
86refusal wrote nothing. Limit: the refusal comes from the object integrity check on the manifest, which treats the damaged
87manifest as absent on a non-blank disk; it is not a separate "slot tag mismatch" message. The SecurityManifest (sealed
88envelopes) was not targeted because it cannot be located without the keys.
89
90## Run E, pi5-unlock-e: byte restored, correct secret S
91
92The original byte was written back (the saved sector was byte-identical on readback) and the Store view hash returned to
93H0 (7954edfc...a9943) before the run.
94
95```
96unlock_source: card request file (QUALIFICATION ONLY, throwaway secret)
97store: identity class=1 (production); anchor lba=0 store lba=32 units=1048563
98store: key source=recovery-keyslot genesis=0 (K_vol source: the Slot 1 recovery descriptor; TPM Slot 0 BLOCKED_HARDWARE; no rotation)
99store: opened generation=3 boot_count=2 prev_commit=55f6cc0130d2932263ef0baece5a89c88a99c739 anchor=valid-resume
100store: committed generation=4 boot_count=3
101store: security manifest sequence=3 generation=4 keyslot=bound previous=linked
102stage store: ok
103```
104
105Result: the Store reopens after the damage is repaired, generation 3 to 4, boot_count 3, SecurityManifest sequence 3 linked
106to the previous one. In every run the request file was deleted from the card and verified absent afterwards.