Repository navigation
soc: apple: sep: let a second Linux install create its Touch ID keybag on M2 Pro/Max - #856
Merged
Merged
Conversation
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
DjDeveloperr
force-pushed
the
sep/keybag-create-xart-window
branch
from
November 2, 2026 12:17
a05f0a6 to
15825b4
Compare
Contributor
|
KUnit results for the new SEP cases, since the build VM couldn't run them. Run with
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. |
This was referenced 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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A fresh Aurora Fedora install on a MacBook Pro M2 Pro (Mac14,9, J414s, T6020) never brought up the SEP.
aurora-sep.servicetimed out after 120 s, fprintd never started, and trusted keys failed with EEXIST. The same Mac already has an Arch Linux ARM install whose Touch ID works. This lets the second install create its own keybag, and lets an install that this already broke recover by itself.What happened
Kernel
7.3.0-11.fc44.aurora(aurora-wip 52f0a6b), first boot of the new install:CREATE_KEYBAG(sks_provision_identity_keybaginsks.rs) makes the enclave rewrite one existing kind-4 record. The guard refused it (Guard::checkinxart_guard.rs), and the enclave did not fail the create. It stopped answering, so the hardware RNG and every later key-store request timed out for the rest of the boot. The guard list stayed empty, so the enclave wrote no new session record, and the only record that changed was the shared kind-2 root (revision 1196 to 1197).The driver writes a create intent before it sends
CREATE_KEYBAGand keeps it when no answer comes, because a bag might exist that nothing names (keybag::readreturns EEXIST for an intent). On the next boot (7.3.0-12, e1524e6) the SEP itself was healthy, with no refusal and the hardware RNG registered. But the driver would not create a keybag again:So this install stays broken on every later boot, whatever kernel it updates to.
Which record, and whose
Record 423ea61c is not the other Linux install's record. It is shared enclave state:
Why the old strictness was wrong here
The guard protects records that exist when the driver opens the gigalocker and that are not on Linux's list. This record predates every Linux install on the Mac, so it is never on the list, and every guarded keybag creation on this Mac asks to rewrite it. Having another Linux install is not what triggers it. ALARM only has a keybag because it made it on 2026-09-17, before the guard existed.
XART-SAFETY.mdlisted guarded creation on M2 Pro/Max as untested, and this is the first measurement.Refusing the write did not keep the record safe from a confused driver. The enclave itself asks for the write, as macOS's enclave did this morning. The refusal left the enclave stuck mid-create and left Linux without a keybag for good.
The change
Keybag creation window (
xart_guard.rs,sks.rs,xart_store.rs)CREATE_KEYBAGexchange runs in the same window a boot policy change already uses (soc: apple: sep: keep Touch ID across a boot policy change #545):/var/lib/aurora-sep-xart-policy-previous.bin, as for a policy change;xart_guard=0. Both kinds of Mac run the same stub sepOS (13.5 here), so the risk to macOS is the same on both and the window applies to both. Whether that M1 record is kind-4 has not been confirmed. If it is not, the create is refused as before, and logged.Unfinished create (
keybag.rs,xart_guard.rs,sks.rs)may_retry_create).Readiness on cold-boot Macs (
xart_guard.rs,diag.rs,aurora-sep-ready)blockedfor being cold-boot, on the grounds that its keybag could only be created with the guard off. That no longer holds, so it reportsunverifiedlike a warm-attach Mac until the guard refuses a write.aurora-sep-readydrops that reason, and its tests and the ABI doc follow.Docs and packaging
XART-SAFETY.md: the creation table rows, the cold-boot notes, and new sections "The keybag creation window" and "An unfinished keybag create".XART-SAFETY.mdandaurora-sep-readyare updated.What still protects macOS's records
Every other session record that existed at probe stays refused, before, during and after the create. That covers the other six kind-4 records, both kind-3 records, and anything another Linux install made. Deletes of existing records are never allowed. Level 2 still refuses the shared roots. The one rewrite has to happen inside Linux's own first keybag creation, can happen once per boot, and is saved first. Nothing is added to Linux's list.
What happens to the ALARM install's Touch ID
Nothing on the ALARM side is read or written. Fedora does not reuse ALARM's keybag or enrolment: it creates its own keybag with its own secret and UUID, and the enclave puts it in its own lane through its own
/chosen/apfs-preboot-uuid. ALARM's keybag, ref-key, catacombs and prints are files on its partition.The one shared change is record 423ea61c. The enclave rewrites it while it creates Fedora's keybag, and ALARM's enclave reads the new version at its next attach. That is the same thing that happened after macOS rewrote the record this morning, though ALARM has not booted since then. I expect ALARM to restore its two enrolled fingerprints as it does now, but that is not verified yet. It is step 5 of the hardware test below. If it fails, the previous value is in Fedora's
/var/lib/aurora-sep-xart-policy-previous.bin. Writing it back would not roll back the enclave's counters, so the evidence has to be kept and nothing reset.Testing so far
drivers/soc/apple/builds with no warnings with Fedora kernel-aurora's -12 config plusCONFIG_KUNIT=yandCONFIG_APPLE_SEP_KUNIT_TEST=y(kernel Rust 1.85.0, LLVM=1). rustfmt finds no new drift.test_sep_ready,test_diag_sensor,test_packagingandtest_ready_pam_hintpass, excepttest_gives_up_waiting. That one times out on this macOS host on the base commit too.test/kernel-aurora-sepfix1, not for merge). KUnit is off in that kernel: the guard suites bump the driver's refusal counter, which would show up in the diag state under test.sep-source.yml(the arm64 KUnit compile) has not run on this PR.Hardware test plan
On the J414s: Fedora on the test kernel from a cold power-on with no module parameter, then fprintd enrol and verify, a reboot to prove persistence, ALARM's restore and verify, and a macOS Touch ID check. The full step list is in the thread. Results will be added here.
🤖 Generated with Claude Code