Skip to content

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

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

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

Conversation

@acrogenesis

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: e61ffc7e9 passed 347 Apple SEP KUnit tests in a diskless aarch64 KVM guest. The host tests also ran on aarch64 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 e61ffc7e9. 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 ARM run used the repository’s drivers/soc/apple/sep.kunitconfig and executed all apple_sep* suites. The registration, wake and post-registration status fixtures passed. The separate SBIO exchange host fixture fails to compile on both the unmodified base and this branch 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>

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.

1 participant