Skip to content

soc: apple: sep: let a second Linux install create its Touch ID keybag on M2 Pro/Max (aurora-wip) - #860

Merged
DjDeveloperr merged 1 commit into
aurora-wipfrom
sep/keybag-create-xart-window-wip
Nov 2, 2026
Merged

DjDeveloperr merged 1 commit into
aurora-wipfrom
sep/keybag-create-xart-window-wip

Conversation

@DjDeveloperr

Copy link
Copy Markdown
Contributor

The aurora-wip copy of #856 (integration/aurora), so the fix reaches the distro kernels, which are pinned from aurora-wip (kernel-aurora 7.3.0-12 is e1524e6).

It is the same commit, cherry-picked onto e40cf4f. None of the 24 commits on aurora-wip since e1524e6 touch the SEP driver, its ABI doc or tools/aurora-sep. Every file is byte-identical to #856 except the Arch PKGBUILD, where only the XART-SAFETY.md and aurora-sep-ready checksums differ from aurora-wip's list.

See #856 for the root cause, the change, what still protects macOS's records, and the effect on the other Linux install. In short:

  • CREATE_KEYBAG rewrites one existing kind-4 record. The guard refused it, the enclave stopped answering, and the leftover intent blocked every later boot with EEXIST.
  • The identity create now runs in the boot policy window: one kind-4 rewrite per boot, previous value saved first, no delete, nothing adopted.
  • An unfinished create is sent again once Linux's list shows it left nothing.
  • A guarded cold-boot Mac now reports matching "unverified" instead of "blocked".

The hardware-test kernel for the J414s is built from this branch. Results will be posted here and on #856.

🤖 Generated with Claude Code

On a MacBook Pro M2 Pro (T6020, J414s), a second Linux install never got
a Touch ID keybag. CREATE_KEYBAG makes the enclave rewrite one existing
kind-4 xART record. That record is one of the four kind-4 records the
enclave reads at every attach. A 2026-09-26 capture from the first Linux
install already has it, and macOS's enclave rewrote it on 2026-11-02
while no Linux install was running. It predates every Linux install, so
it is never on Linux's list, and xart_guard=1 refused it. The enclave
did not fail the create. It stopped answering, and the hardware RNG and
every later key-store request timed out. The driver also kept its create
intent, so every later boot refused to create a keybag ("identity keybag
state is ambiguous: EEXIST"), and trusted keys failed with EEXIST.

The other Linux install is not the cause. Every guarded keybag creation
on that Mac asks for the same rewrite. The first install has a keybag
only because it was made before the guard existed. An M1 Pro (T6000)
rewrites one pre-Linux attach record the same way. It runs the same
stub sepOS, so the risk to macOS is the same, and so far it has needed
xart_guard=0.

Run the identity CREATE_KEYBAG in the window a boot policy change
already uses. It allows one rewrite per boot, of one kind-4 record that
existed at probe. It never allows a delete or another kind, the roots
follow the level, the previous value is saved on the host first, and
nothing is adopted. The exchange now waits up to 6 s, as a 13.5 key
store's does, because the saved value and the new slot are flushed
inside it. Every other session record that existed at probe stays
refused, before, during and after the create. That includes any record
another Linux install made.

Make an unfinished create recoverable. The intent now records how long
the guard's list was. New session records are listed before they are
written, so a later boot whose list has not grown knows the create left
nothing behind, and sends it again. An intent from an earlier kernel
records no length. It is sent again only while the list is empty, which
recovers the installs this refusal already left stuck.

A guarded cold-boot Mac is no longer reported as matching "blocked"
just for being cold-boot. That rule assumed its keybag could only be
created with the guard off. It is now "unverified", like a warm-attach
Mac, until the guard refuses a write. aurora-sep-ready drops the
matching reason, and the ABI doc and XART-SAFETY.md follow.

KUnit covers the window's terms, the list length kept from load, the
retry rule, and the intent format, including the zero-UUID intent that
earlier kernels wrote.

Signed-off-by: DjDeveloperr <[email protected]>
Assisted-by: Claude:claude-opus-5-5
@RyanTheTide

Copy link
Copy Markdown
Contributor

KUnit results for the new SEP cases, since the build VM couldn't run them. Run with kunit.py run --arch=arm64 under qemu on the buildbox, on aurora-wip c243830 with #860 merged (the same commit as 856), against plain c243830.

  • apple_sep_xart_guard: 33 of 33 pass (27 on the base).
  • apple_sep_keybag: 3 of 3 pass (new suite).
  • Every other SEP suite gives the same result as the base.
  • Four apple_sep_host_store cases fail, but they fail the same way on plain aurora-wip, so they aren't from this PR: existing_empty_and_zero_files_are_initialised, a_created_flag_keeps_valid_records_and_retries_blank_files, interrupted_creation_is_retried and blank_creation_is_distinguished_from_damaged_state, all "host-state store failed validation (Size)".

Merged with the other open aurora-wip PRs, the apple-dcp host selftests also stay at the base count. I'm leaving this unmerged until the J414s run in your test plan is posted, since we don't have that hardware and the change rewrites a macOS-side SEP record.

@DjDeveloperr
DjDeveloperr merged commit 16f4df8 into aurora-wip Nov 2, 2026
notmysegv pushed a commit to notmysegv/linux that referenced this pull request Nov 4, 2026
Bring integration/aurora up to aurora-wip 437edfa, the source of the
7.3.0-aurora-fleet14b kernel that was promoted on the M1 Pro, M2, Neo
and J616s on 2026-11-01. This takes the aurora-wip work since the
two branches diverged, including the 2026-11-01 sync of
integration/aurora into aurora-wip (aurora-silicon#761), up to and including aurora-silicon#764.

integration/aurora had two changes aurora-wip lacked at this point:
the tipd late USB4 router fix (aurora-silicon#855) and SEP keybag creation in the
shared xART window (aurora-silicon#856). aurora-wip carries the same patches as aurora-silicon#858
and aurora-silicon#860, which come in with a later batch. Two conflicts, both where
the two sides added lines next to each other: the KUnit prototype list
in tps6598x.h (both kept, in aurora-silicon#858's order) and the aurora-sep PKGBUILD
checksums (recomputed from the merged files; they match aurora-silicon#860's). The
merged tree is identical to aurora-wip 437edfa with the aurora-silicon#858 and aurora-silicon#860
patches applied.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
notmysegv pushed a commit to notmysegv/linux that referenced this pull request Nov 4, 2026
…nto integration/aurora

Bring integration/aurora up to the aurora-wip tip 9ff2b9a. After this
merge the two branches have the same tree.

The range contains the fleet14o source c243830 (aurora-silicon#857, aurora-silicon#858, aurora-silicon#795,
aurora-silicon#859), which was promoted on all four machines on 2026-11-02 and 03, and
the merges after it: aurora-silicon#861 (apple-dcp selftest stubs for aurora-silicon#858), aurora-silicon#860
(SEP keybag in the shared xART window, the aurora-wip copy of aurora-silicon#856),
aurora-silicon#724 (J616s boot NOR, both parts), aurora-silicon#779 (ALS colour temperature ABI),
aurora-silicon#862 (J700 GD25UF16E boot NOR, the Neo bless fix), aurora-silicon#863 (J616s ANE H16
start stall), aurora-silicon#797 (T6000 DCS whole-word writes) and aurora-silicon#803 (G17 keeps
innocent clients alive across another client's recovery).

aurora-silicon#858 and aurora-silicon#860 make the same changes integration/aurora already had as
aurora-silicon#855 and aurora-silicon#856, so they merge without conflicts.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
@RyanTheTide
RyanTheTide deleted the sep/keybag-create-xart-window-wip branch November 7, 2026 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants