Skip to content

soc: apple: sep: keep Touch ID across a boot policy change - #545

Merged
RyanTheTide merged 3 commits into
integration/aurorafrom
fix/sep-boot-policy-change
Oct 29, 2026
Merged

RyanTheTide merged 3 commits into
integration/aurorafrom
fix/sep-boot-policy-change

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Touch ID on the J616s (M4 Pro) stopped working after a Stage 1 reinstall, and every boot waited two minutes for it. This keeps Touch ID and its fingerprints across a boot policy change, and stops the enclave from holding the boot back at all.

What happened

A new Stage 1 changes the boot policy the Mac keeps for Linux. The first time Linux's identity keybag is unlocked under the new policy, the enclave rewrites one session record in the shared xART gigalocker. Linux did not create that record, so the xART guard refused the write. The enclave then never answered CHANGE_LOCK_STATE, the machine ref-key stayed down, and every trusted-key seal failed with EIO. The keybag, the ref-key and the enrolled fingerprints were all intact.

Under the old policy the same kernel unlocked the keybag with no session record write at all. That is what makes the change detectable.

The change

Driver (xart_guard.rs, xart_store.rs, refkey.rs)

  • During the first unlock of an identity keybag that already existed, the guard lets one rewrite through, once per boot:
    • one kind-4 session record, a rewrite, never a delete or a shared root;
    • only after the record's previous value is durable in /var/lib/aurora-sep-xart-policy-previous.bin;
    • the record is not added to Linux's list.
  • A ref-key created this boot closes the window.
  • For anything the window does not cover, a one-time allowance file left by aurora-sep-policy-change allows the same thing on the next boot. The driver empties that file before it uses it.
  • Refusals now name the record's session id. The guard's list file already holds session ids.

Userspace (tools/aurora-sep)

  • aurora-sep.service is no longer ordered before multi-user.target.
  • The login screen no longer waits for Touch ID. This folds in the boot-time fix: aurora-sep-greeter-refresh.service shows the login screen again once Touch ID is up, if nobody has logged in.
  • aurora-sep-load stops at the first guard refusal and says why, instead of retrying a seal every 100 ms for two minutes.
  • aurora-sep-policy-change backs up the 6 MiB gigalocker extent, the driver's host files and /var/lib/fprint with SHA256SUMS, then arms the allowance. With no arguments it allows the record refused this boot; --expect arms it before a planned change.
  • Packaging: Fedora 1-9, Arch pkgrel 14. This also adds the Arch link for aurora-sep-greeter-refresh.service, which the PKGBUILD already listed.
  • XART-SAFETY.md has a new "Boot policy changes" section.

Tested on the J616s (aoplid2, apple-sep built from this tree with #543)

  • Before: userspace boot took 2 min 1.6 s, with about 1,100 seal-failure warnings.
  • With the non-blocking unit and the loader fix: graphical.target in 11.1 s, one warning, and a clear message from the loader.
  • Manual allowance for the refused record:
    • Touch ID came back on the next boot: "restored 1 enrolled identity".
    • The enrolled finger matched in fprintd-verify, and kept matching after later reboots.
    • Gigalocker: the one kind-4 record and one shared root were rewritten. The other six kind-4 records and the kind-3 record kept their revisions.
    • The allowance file was empty afterwards.
  • Still to do: a normal boot with the automatic window (expect no rewrite), then a second Stage 1 change booted with no manual step.

Depends on nothing. #543 (warn once on seal failure) is complementary.

🤖 Generated with Claude Code

RyanTheTide and others added 3 commits October 28, 2026 21:53
aurora-sep-greeter-fingerprint.service held gdm back until
aurora-sep-ready.service finished, so the login screen would find the
reader and its fingerprints. The enclave takes tens of seconds after boot,
and when it does not come up the job timeout holds gdm until 90 s after
boot. On the J616s the desktop appeared at 95 s; with automatic login that
wait bought nothing at all.

The greeter unit now only prepares the login screen's shell and no longer
waits for Touch ID. A new aurora-sep-greeter-refresh.service runs once
both gdm and Touch ID are up. When nobody has logged in yet, it shows the
login screen again so it asks fprintd for the reader again and offers
fingerprint. With automatic login, or once anyone has logged in, it
changes nothing, since restarting gdm would end their session. Enabling
the greeter unit enables the refresh unit with it.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A new Stage 1 changes the boot policy the Mac keeps for Linux. The first
time Linux's identity keybag is unlocked under the new policy, the
enclave rewrites one session record that already existed. Linux did not
create it, so the xART guard refuses the write. The enclave then never
answers CHANGE_LOCK_STATE, the machine ref-key stays down and every
trusted-key seal fails with EIO, so Touch ID is gone until the policy
changes back. On a J616s (T6040) this happened after a Stage 1 reinstall
that changed only the kernel collection hash.

Under an unchanged policy that first unlock rewrites no session record at
all, so a rewrite inside it is the policy change. Let exactly one through:
during the first unlock of an identity keybag that already existed, once
per boot, one kind-4 session record, a rewrite and never a delete, and
only once the record's previous value is durable in a host file. The
record is not added to Linux's list. A ref-key created this boot closes
the window.

For a change the window does not cover, aurora-sep-policy-change leaves a
one-time allowance in /var/lib/aurora-sep-xart-allow-once.bin naming the
refused record, or before a planned change the first existing kind-4
record asked for. The driver empties the file at probe before it uses
it, so an allowance lasts one boot, on the same terms.

Name refused records by their session id. Linux's list of records
already holds session ids, so this reveals nothing new.

On the J616s the allowance restored Touch ID with the existing enrolment:
one kind-4 record and one shared root were rewritten, the other seven
session records kept their revisions, and the enrolled finger matched.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…r hold the boot for it

aurora-sep.service was ordered before multi-user.target, so a boot whose
enclave did not come up waited for the loader's full two-minute timeout.
On a J616s after a Stage 1 reinstall, userspace took 2 min 1.6 s. It now
has no ordering before multi-user.target. fprintd and aurora-sep-ready
still wait for it, and the login screen no longer does.

aurora-sep-load retried the seal every 100 ms for those two minutes even
when the xART guard had refused the enclave's write, which does not go
away by waiting. It now stops at the first refusal and says what happened
and what to run. The same J616s reached graphical.target in 11.1 s, with
one seal failure logged instead of about 1,100.

The driver now follows a boot policy change by itself. When it logs
that it did, aurora-sep-load notes the m1n1, iBoot and OS firmware
versions the boot came up with. For a change it could not follow,
aurora-sep-policy-change backs up the gigalocker, the driver's host
files and the fingerprints, then arms the driver's one-time allowance:
with no arguments for the record this boot refused, or with --expect
before a planned change. XART-SAFETY.md describes the event, the
automatic update and the allowance.

The Arch package also gets the aurora-sep-greeter-refresh.service link
that its PKGBUILD already lists.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Tested on the J616s (M4 Pro), 2026-10-29, kernel 7.3.0-aurora-fleet8 with this driver:

  • Two normal boots (m1n1 Stage 1, then aura Stage 2): no record rewrite, no refusal, no seal failure.
  • Stage 1 change, m1n1 32e60029 to aura 1.0b1, with nothing armed: on the first boot the guard allowed one rewrite of kind-4 record 1070015f by itself and kept its previous value. Trusted keys sealed and unsealed in 4 s, and aurora-sep-load reported the policy change with the fingerprints kept. The enrolled finger is still listed.

That covers both remaining items from the description.

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.

1 participant