Skip to content

SEP: preserve sealed trusted keys through content-changing keybag saves and reboot #23

Open

Description

@chriskearney

J316S reported existing reference-key unseal failures after an identity-keybag update. Immediate admission of a newly sealed blob is fixed; it does not preserve old blobs through content-changing saves. Fingerprint enrollment restoration already works on several Macs and is a separate guarantee.

Priority: P1 · Readiness: investigation · Implementation owner: kernel

Baseline: Aurora 2026.10.11.13, development commit 5dcdeb8cda8dafe203d4d2f03952ade392c3fe23. Earlier reproductions retain the exact versions above.

Code: drivers/soc/apple/refkey.rs · drivers/soc/apple/sks.rs · drivers/soc/apple/sbio.rs · Documentation/security/keys/apple-sep.rst

Completion criteria: In a separately prepared test context, distinguish unchanged resnapshot, enrollment/deletion and sensor re-registration. Pre-existing sealed keys must unseal byte-identically after each admitted save and cold reboot; new/load and fingerprint matching must still work. Interruptions must retain recoverable state and explicit errors. Replacing keys and orphaning old blobs is not completion.

Original reports/candidate: original #31

This ticket carries forward the remaining work; source inclusion, release delivery and hardware acceptance are recorded separately.

Activity

  1. added
    priority:P1
    status:investigation
    owner:kernel
    area:sep
    launch:follow-up
    on Oct 11, 2026
  2. cb2206 commented on Oct 12, 2026

    @cb2206

    J314S (14" M1 Pro, apple,t6000), Aurora 2026.10.11.15 (7.1.12-2-20261011.15-sep-ARCH, stock release, no local SEP changes). The SEP platform profile reports T6000/J316s, so this is the same profile as the original J316S report. Default ref-key slot (refkey_v2 = 0), ref-key file from 2026-09-29, 2 enrolled identities. The keybag/ref-key/host-state files were backed up (root, 0600) before every phase. Nothing was deleted or regenerated.

    Method: before each step I sealed a throwaway new 32 trusted key Tn, plus an encrypted key En = new trusted:Tn 32, and saved both blobs. The check loads Tn from its blob into a fresh keyring, then loads En. The encrypted-key HMAC only verifies if the unsealed key is byte-identical. After every step, all earlier blobs were checked and a new one sealed.

    Step Keybag file Earlier blobs
    0: baseline seal (ref-key 12 days old, many resnapshots since) – T0 sealed, admitted
    1a/1b: three matches, two back to back rewritten each time T0–T2 byte-identical
    2: no-match (unenrolled finger) rewritten T0–T3 byte-identical
    4: cold boot (poweroff), checked before any sensor use – T0–T4 byte-identical
    5: enrol a third finger rewritten T0–T5 byte-identical
    6: delete that finger (fprintd-delete -f) rewritten T0–T6 byte-identical
    7: cold boot, checked before any sensor use, then a match rewritten after the match T0–T8 byte-identical

    New seals worked at every step, and matching works afterwards (2 identities restored at each boot).

    The keybag content never changed here. The file was rewritten by every verify (match and no-match), by the enrolment and by the deletion. Its sha256 was the same in all five backups, including after the enrolment and after the deletion. Only aurora-sep-host-state.bin changed. On this machine every verify start also re-registers the sensor (registering sensor at bring-up stage 2 + CLEAR_STATE for sensor re-registration), so "resnapshot only" and "resnapshot + re-registration" can't be separated here, and neither strands a blob.

    So on J314S none of these operations is a content-changing identity-bag save, and the #23 trigger did not reproduce. This matches the earlier observation on #31 that an unchanged resnapshot survives reboot. It means the J316S failure needs something these steps don't produce, which would rewrap the bag itself. The re-registration bursts right before the 06:00:22 resnapshot in the original report might be one candidate. I can't force that here without changing the driver. If there's a debug build that logs when the copied bag differs from the stored one, I can run it.

    Not covered: interrupted saves (no power cut mid-write), the refkey_v2 slot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:seplaunch:follow-upowner:kernelpriority:P1status:investigation

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions