Repository navigation
soc: apple: sep: gate per-user key bags on a proven capability, not the create variant - #1824
RyanTheTide wants to merge 2 commits into
Conversation
…he create variant userbag_ioctl refused per-user key bags unless profile.key_store was the variant-5 create encoding. That encoding describes how the identity key bag is created, not whether the enclave can create a NEW per-user bag. T8112 (M2) and T8122 (M3) are warm-register platforms whose SEP is handed over running and shared with macOS; their identity bag uses the variant-5 form, so they passed the Variant5 check, yet their enclave never replies to a user-bag DESIGNATE_KEYBAG. A single unanswered DESIGNATE condemns the SKS endpoint for the rest of the boot (sks_wedged), taking the whole key store down: the log shows "DESIGNATE_KEYBAG got no reply" followed by every later SKS request reporting "endpoint gone for this boot". Per-user bag create and designate are proven only on T8140 (J700) and the T6040 (J616s / M4 Pro) enclave family. Add an explicit PlatformProfile capability, per_user_keybags, true only on those, and gate userbag_ioctl and the per-user-bag ref-key / FDE paths on it instead of on the create-encoding variant. The unsupported platforms now return EOPNOTSUPP before any enclave request, so the SKS endpoint is never wedged. Touch ID and the identity bag are unaffected: neither uses userbag_ioctl. The sep KUnit suite passes (598 run, 596 passed, 2 skipped, 0 failed). Assisted-by: LLM Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
M2 hardware proof row — PASSBuilt a proof kernel Before (fleet72, unfixed): After (sepkb1, this PR): T8112 →
No-regression by construction (Neo T8140, M1 Pro Sepos13): this diff only changes the gate outcome on the Variant5 platforms flipped to Neo (no-regression) and M1 Pro (unchanged) hardware confirmations are still owed but both Macs were unavailable this session (Neo wedged under an ORCH4 hold awaiting a power press; M1 Pro held by another lane). The proof kernel + Neo stage are built and staged for whoever runs the qualification pass. |
per_user_keybags was a list of the enclaves where a user-bag create and designate had been run: true on T8140 and the T6040 family, false everywhere else. That makes every enclave nobody has tried refuse, and says nothing about why the one measured failure fails. The user-bag requests are part of the variant-5 key store; the 13.5 key store has no such requests. The one measured defect is the T8112 (J415) enclave, which returns a handle for CREATE_KEYBAG and then never answers DESIGNATE_KEYBAG, condemning the SKS endpoint for the boot. Name that defect, designate_unanswered, set it on T8112 only, and derive per_user_keybags() from the key store variant and that flag. T8122 no longer inherits the flag from the T8112 profile it extends: the unanswered DESIGNATE was measured on J415, not on an M3. T6020 on current firmware, T8122, T8132 and T8142 therefore offer per-user key bags; none of them has run a user-bag DESIGNATE yet. T8103, T6000 and T6020 on the 13.5 key store keep refusing, as does T8112. Add a KUnit case covering per_user_keybags() for every profile. Signed-off-by: Ryan <ryan@aurorasilicon.org>
|
Still needed: a Neo (J700) row showing a per-user key bag enrol still succeeds on this head, then ready-marking. Both commits carry an Assisted-by trailer, so they need re-committing with a human Signed-off-by only. |
|
Replaced by #2806: the same changes with the commit trailers fixed, on the current integration/aurora. |
Problem
userbag_ioctlallowed per-user key bags wheneverprofile.key_store == Variant5. That field records the identity-bag create encoding, not whether the enclave can create a new per-user bag.T8112 (M2) and T8122 (M3) are warm-register platforms: iBoot hands over a running SEP that is shared with macOS. Their identity bag is created with the variant-5 form, so they passed the
Variant5check — but their enclave never answers a per-userDESIGNATE_KEYBAG. One unanswered DESIGNATE condemns the SKS endpoint for the rest of the boot (sks_wedged), so the whole key store goes down. On an M2:CREATE_KEYBAGsucceeds first and returns a handle; only theDESIGNATEof that handle hangs. The path is not gated on any boot measurement or policy, so it is independent of the boot chain state.Fix
Add an explicit
PlatformProfilecapability,per_user_keybags, true only where per-user bag create/designate is proven on hardware: T8140 (J700) and the T6040 (J616s / M4 Pro) enclave family. Gateuserbag_ioctland the per-user-bag ref-key / FDE paths on it instead of on the create-encoding variant.The capability is now
per_user_keybags(), derived from the variant-5 key store and adesignate_unansweredflag set only on T8112, the one enclave where the unanswered DESIGNATE was measured; T6020, T8122, T8132 and T8142 have no measurement of their own and now offer per-user bags until a row says otherwise.Unsupported platforms now return
EOPNOTSUPPbefore any enclave request, so the SKS endpoint is never wedged. Touch ID and the identity bag are untouched: neither usesuserbag_ioctl.Test
sep KUnit suite: 598 run, 596 passed, 2 skipped, 0 failed.
Draft: still owes a hardware row — a per-user enrol still succeeds on the Neo; the M2 and M1 Pro now refuse with
EOPNOTSUPP, no SKS wedge, Touch ID intact.Assisted-by: LLM (Claude:Opus 5.5)