Skip to content

soc: apple: sep: Recover sensor serial registration before enrollment and verification - #3674

Draft
acrogenesis wants to merge 4 commits into
aurora-silicon:mainfrom
acrogenesis:fix/touch-id-registration-recovery
Draft

acrogenesis wants to merge 4 commits into
aurora-silicon:mainfrom
acrogenesis:fix/touch-id-registration-recovery

Conversation

@acrogenesis

@acrogenesis acrogenesis commented Nov 30, 2026 •

Copy link
Copy Markdown

What: Recover a failed Touch ID sensor serial exchange before enrollment or verification. On a 16-inch M1 Max the sensor could refuse registration before the user made a first touch.

Tested: At 4696cd92275b, all 365 Apple SEP KUnit tests passed in a diskless arm64 KVM guest, including recovery from two consecutive registration refusals. Twelve focused host tests passed on arm64 with Rust 1.85. The J316c M1 Max hardware results below used the earlier 7.2 backport.

Risk: Two-way door for Macs with a built-in Touch ID sensor. The change affects sensor startup and cancellation.

Not yet: A physical enrollment, verification and post-reboot match at 4696cd92275b. The J313 M1 Air could not stage the old 7.2 kernel.

Driver changes

A request that needs a fresh registration uses the existing recovery sequence, with at most three back-to-back attempts. A failed serial read and the exact 32-bit REGISTER_SERIAL reply 0x16 qualify for the additional attempts. Other errors keep their existing behavior. A working registration retained for the same authentication can be reused on the next touch.

Cancellation is checked on entry and on completion. A request that ends during registration releases the sensor before enrollment or capture begins. Cancellation while waiting for lift in a still-open match preserves the pairing of that match with its registered sensor. The existing attach and cold-restore recovery policies remain in use. The driver exposes the t6000_registration=1 metadata that the packaging probe reads.

The cause of intermittent sensor bring-up failures remains under investigation. Aurora issue #2322

Evidence and credits
  • On the physical J316c, three earlier requests recorded an accepted CLEAR_STATE followed by a REGISTER_SERIAL refusal 26–33 ms after power-on. The earlier backport recovered a verification on retry. Enrollment and an independent match succeeded on the combined backport. The regression fixture models two consecutive refusals and recovery on the third, fresh registration. Original report and prior test results
  • The standard drivers/soc/apple/sep.kunitconfig build hits the same compile error on main at f02bd68a08cb and this head. The M5 GPU KUnit fixture supplies attachments and timestamps fields that Validated::Render does not have. The SEP run used that config with DRM disabled and DMA-BUF heaps enabled to supply the shared-buffer dependency. All apple_sep* suites ran. The separate concurrent SBIO exchange host fixture fails to compile on both base and head because its mock condition variable lacks wait_timeout.
  • This ports the original registration work from soc: apple: sep: Retry T6000 sensor registration for verification and enrollment omacom/linux-aurora#525 without its merge commit. The capability marker carries the original commit and sign-off. Dj and Ryan Murray developed the SEP driver. This uses Ryan’s existing registration retry and session recovery code. @alxzndr tested the earlier series on J314s, and Naeem Malik tested staging on J313 and requested this port. Registration recovery · Session recovery · J314s hardware report · J313 staging report

On a J316c the enclave accepted CLEAR_STATE but refused REGISTER_SERIAL
with status 0x16 before the first scan. Enrollment also failed while
reading the sensor serial. Use the existing bounded registration round
when either serial exchange fails before a fresh verify or enrollment.
Keep the nonce-session verify recovery and the attach and restore policies.
A different failure still ends enrollment or a plain-session verify.

Check whether the operation still owns the reader before bring-up and as
it completes. An existing match that waits for finger lift keeps its
registered sensor and match context together. An abandoned new request
cannot open an enrollment or start a capture. No comparison is retried.

This ports omacom/linux-aurora#525 onto the shared 7.3 capture path. The
serial exchange and recovery policy build on Dj's and Ryan Murray's SEP
driver and Ryan's prior registration and session recovery changes. The
underlying intermittent sensor bring-up failure remains tracked in aurora-silicon#2322.

Link: omacom/linux-aurora#525
Link: aurora-silicon#2322
Signed-off-by: Adrian Rangel <adrian@acrogenesis.com>
Setup needs to check the on-disk driver before enabling Touch ID. A
driver can already have the storage guard and still fail to register the
reader for an interactive operation on J316c.

Expose t6000_registration=1 in an object linked into every apple-sep
build. This identifies support for bounded retries before both verify
and enrolment and is available to modinfo without loading the driver.

Signed-off-by: Adrian Rangel <adrian@acrogenesis.com>

(cherry picked from commit ee066bf4c74687c71ed44835c1b80d93b09f8b39)
Drive the production authentication adapter for a failed serial read, a refused registration, and an enclave that retains an unfinished registration. Check that a distinct 32-bit failure is final.

Signed-off-by: Adrian Rangel <adrian@acrogenesis.com>
@RyanTheTide

Copy link
Copy Markdown
Contributor

@acrogenesis this draft conflicts with main (f02bd68a08cb) in drivers/soc/apple/sbio.rs. Could you merge main in? A merge commit is fine, no force push needed. If you'd rather we do it, say so. If we don't hear back within 24 h, we'll forward-merge it on your branch with a merge commit (maintainer edits are on) and keep your authorship.

Keep the signed sensor root key lookup from main alongside the wake path that reports retryable serial registration failures.

Signed-off-by: Adrian Rangel <adrian@acrogenesis.com>
@acrogenesis

Copy link
Copy Markdown
Author

Merged main at f02bd68a08cb in 4696cd92275b. The resolution in sbio.rs keeps the sensor root key lookup from main and passes serial registration failures back to the Touch ID retry logic.

All 365 Apple SEP KUnit tests passed in a diskless arm64 guest with DRM disabled, and 12 focused host tests passed. I reproduced the M5 GPU test compile error with the standard config on both the base and the merge. Physical enrollment and verification on this revision are still pending.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Thanks @acrogenesis. I checked the workflow change (one added unittest step) and approved the CI runs at 4696cd92275b, so they're running now.

1 similar comment
@RyanTheTide

Copy link
Copy Markdown
Contributor

Thanks @acrogenesis. I checked the workflow change (one added unittest step) and approved the CI runs at 4696cd92275b, so they're running now.

This branch has not been deployed

No deployments
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