Skip to content

soc: apple: sep: Retry T6000 sensor registration for verification and enrollment - #525

Closed
acrogenesis wants to merge 12 commits into
omacom:integration/aurorafrom
acrogenesis:fix/t6000-touchid-verify-registration
Closed

acrogenesis wants to merge 12 commits into
omacom:integration/aurorafrom
acrogenesis:fix/t6000-touchid-verify-registration

Conversation

@acrogenesis

@acrogenesis acrogenesis commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

On the 16-inch MacBook Pro with M1 Max (J316c/T6001), both Verify and Enroll could stop before the first fingerprint scan. During verification the sensor sometimes returned REGISTER_SERIAL status 0x16 within 33 ms of power-on. Two enrollment requests also failed during startup, including a timeout reading the sensor serial.

This PR gives the T6000 profile up to three attempts to register the sensor before verification or enrollment proceeds. Verification reuses the established registration on the second attempt and can register afresh on the third. Both operations check that the request is still active after bring-up, before starting a verification capture or opening an enrollment in the enclave. Cancellation after a startup attempt powers the sensor down and records the settling interval. A failed bring-up also powers the sensor down. A cold restore proof releases the sensor without starting a capture settling interval. A preceding capture still gets the rest of its own interval. Capture, matching, and template storage follow their normal paths once registration succeeds.

The original two verification commits and the two enrollment commits from #526 are preserved, including their sign-offs. This builds on the SEP driver by Dj and Ryan Murray and reuses Ryan’s existing registration and session recovery work. Registration retry · Session recovery

The per-profile retry settings are shared by the startup code. The module advertises t6000_registration=1 so the Mac package can require both T6000 fixes before enabling first setup. The earlier test commit checked that other profiles keep one attempt. Its companion cancellation commit powers the sensor off when a request goes away during bring-up, before the enclave starts enrollment. The merge commit preserves both original series and their sign-offs.

Verification

  • Built revision f0956f34f2b0 in the ARM Lab and booted the image in diskless ARM KVM. All 123 SEP KUnit tests passed, including apple_sep_registration.t6000_verify_retries_register_serial_0x16_from_fresh. The official host-test runner also discovers and passes the enrollment startup suite. The module metadata contains apple_sep.t6000_registration=1.

  • On the original M1 Max boot, the sensor accepted CLEAR_STATE and refused REGISTER_SERIAL at 26, 30 and 33 ms after power-on on three separate requests. The regression tests model that refusal and check a fresh registration on attempt three. The third-attempt recovery in this test is simulated.

  • The verification and enrollment host tests exercise the production startup paths, including recovery on a third attempt, exhausted attempts, cancellation during a successful retry or a cold restore proof, and single-attempt profiles. Both passed along with the sensor wake, sensor recheck, and SBIO exchange tests.

  • On the verification backport, all 137 tests in 10 SEP KUnit suites passed. On the physical M1 Max, the first verification registration failed and a retry recovered. A saved finger also authenticated a fresh sudo request on that boot. Verification hardware results

  • ARM Lab built the two fixes together against the guarded Stable backport. A diskless guest booted the packaged 7.2.11-14-1-ARCH kernel and loaded that module with storage writes and provisioning disabled.

  • The physical M1 Max subsequently booted the same combined module. The first enrollment returned enroll-unknown-error during fprintd’s duplicate-fingerprint check. The kernel reported sensor state 9 during capture. On the next request the Qt window recorded nine accepted scans, enroll-completed, and a separate verify-match on the new print. The xART guard stayed at level 1 with zero refusals. This boot recorded no registration retry. The successful enrollment and match are confirmed; the first-attempt capture error remains open. Combined hardware results

  • On a 14-inch M1 Pro (J314s), @alxzndr tested the four original retry commits with Naeem Malik’s #506 storage guard. Enrollment and verification worked, then all three verification attempts after reboot matched. The manual setup used the model-specific calibration filename apple/mesacal-j314s.bin. J314s hardware report

The physical runs used the four original retry commits. The later cleanup and timing changes have host and ARM KUnit coverage. A physical cold-restore timing measurement and a J313 run on the revised head remain open. The J313 tester reported that their kernel staging step could not find mt7932_fullmac.

The M1 Max testing used OS firmware 13.5; the reported system firmware version was unknown. The current desktop panel changes are in Omarchy #20348.

On a J316c M1 Max, REGISTER_SERIAL can return 0x16 within 33 ms of sensor power-on. Verification then returns a driver error before any capture. The existing bounded retry only applies to verifies on the nonce-session profile.

Select the registration policy per profile and give T6000 the existing three-attempt verify recovery. Keep the retry before capture and scoped to the live request. Exercise a refused session clear followed by a successful fresh registration in KUnit.

Signed-off-by: Adrian Rangel <adrian@acrogenesis.com>
Signed-off-by: Adrian Rangel <adrian@acrogenesis.com>
@acrogenesis
acrogenesis marked this pull request as ready for review November 26, 2026 06:09
@greptile-apps

greptile-apps Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Confidence Score: 5/5 · The changes appear safe to merge; no actionable new issue was found.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The changes appear safe to merge; no actionable new issue was found.

Summary

Adds up to three sensor registration attempts before verification and enrollment on T6000 machines.

  • Verification retries sensor registration before starting a fingerprint scan.
  • Enrollment retries sensor registration before opening an enclave session.

No actionable new issues were found. Test execution and hardware checks were not repeated during this review.

Reviews (3) · Last reviewed commit: "selftests: aurora-sep: Run enrolment bri..." · Reviewed by Greptile

The J316c M1 Max can time out reading the sensor serial before its first scan. Retry registration while the original enrolment is live, before creating any enclave enrolment. Preserve the single startup attempt on other profiles.

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

Copy link
Copy Markdown
Member Author

On the physical M1 Max running this patch together with #526, the Qt setup window enrolled a new print on the second attempt and a separate verification matched it. The first enrollment attempt hit sensor state 9 during the identification capture. This boot had zero xART guard refusals. Hardware test details.

Signed-off-by: Adrian Rangel <adrian@acrogenesis.com>
Registration may succeed after userspace has cancelled the verify. Recheck the session before entering capture and power the sensor down when cancellation wins during bring-up. Exercise cancellation on both the failed and the successful registration paths.

Signed-off-by: Adrian Rangel <adrian@acrogenesis.com>
The optional cold restore proof can power up the sensor before normal verification starts. Check whether the request is live before starting or retrying the proof, and release the sensor before returning to the capture path. Exercise cancellation during failed and successful cold proofs with the production method.

Signed-off-by: Adrian Rangel <adrian@acrogenesis.com>
@acrogenesis acrogenesis changed the title soc: apple: sep: Retry verify-time sensor registration on T6000 soc: apple: sep: Retry T6000 sensor registration for verification and enrollment Nov 26, 2026
@malik-na

Copy link
Copy Markdown
Member

Review and hardware test at 7043dc5.

Hardware

Mac Build Result
J313 / T8103 (MacBook Air M1) 7043dc5 not tested on this Mac: the kernel could not be staged (ERROR: module not found: 'mt7932_fullmac')

Code review

  • minor drivers/soc/apple/profile.rs:159: Verify and enrol choose their retry policy in different ways. Verify reads a per-profile Retry value (verify_registration). Enrol uses a per-profile bool that switches on a hard-coded registration::VERIFY inside sbio.rs. That gives the profile two separate flags for the same idea, and enrol's attempt count is set in the wrong place. A single enrol_registration: Retry field, set to ONCE or VERIFY like the verify field, would remove the bool and the if/else in bring_sensor_online_for_enrol. It would also make the ONCE profiles plainly keep their single attempt.
  • minor drivers/soc/apple/sbio.rs:1839: The two failure paths now treat the sensor differently. If the request is cancelled during bring-up, the new code idles the sensor, powers it off and records the settle time. If all attempts fail, the code still only idles the sensor, so it stays powered and last_capture_end_ns is not updated. Up to three attempts can now run before this point. The verify path at line 1616 has the same mismatch. Calling power_down_capture_sensor() on the give-up paths too would release the reader the same way on every exit.
  • minor drivers/soc/apple/sbio.rs:1815: Some commit messages explain nothing. 'selftests: aurora-sep: Exercise verify retries with per-profile policies' and 'soc: apple: sep: Power down after cancelled enrolment bring-up' have no body, and the series also contains a merge commit. The second one adds the cancellation power-down in this function, which changes behaviour. Its message should say why, as the other commits in the series do.
  • question drivers/soc/apple/sbio.rs:1555: retry_restore_proof used to only idle the sensor after the proof. It now calls power_down_capture_sensor(), which records a capture end. A few lines later, run_verify calls settle_before_capture(), which sleeps for whatever is left of MATCH_SETTLE_MS since that capture end. So a verify that needs the cold proof now waits for the full settle time before its own bring-up, even though nothing was captured. That adds latency for someone waiting on sudo or a login. Is this delay intended? This path was only run in the host harness, never on hardware.
  • question drivers/soc/apple/registration.rs:816: The PR adds a KUnit test that bring-up recovers from a refused serial on T6000, but the KUnit job in CI was skipped. The description reports 137 passing KUnit tests only on "the verification backport", not on this head, so the new KUnit case has not been shown to pass on this tree. The test also models a refused CLEAR_STATE re-registration. The field failure was REGISTER_SERIAL returning 0x16 shortly after power-on, and the test does not show that the third attempt, which starts a fresh registration, fixes that case. Please run KUnit on this head and confirm the test reproduces the failure seen on the M1 Max.

CI at this head: 10 passed, 0 failed, 0 pending.

Not tested: Touch ID enrolment and matching (the lab boot does not scan a finger).

Verification already gets its retry budget from the platform profile.
Give enrolment its own Retry value so both operations use the same
bring-up path. T6000 can retry twice before opening an enclave session.
All other profiles continue to make one enrolment attempt, including
T8140, which retries registration only for verification.

Signed-off-by: Adrian Rangel <adrian@acrogenesis.com>
A request can end while registration is touching the sensor, even when
it eventually succeeds. Power down before reporting an exhausted verify
or enrolment and when the enclave declines to open the enrolment. As on
cancellation, a later verify can then observe the settling interval.

The optional cold-restore proof also borrows the reader but takes no
image. Power it off without overwriting the timestamp of an earlier
capture. Restarting the 1.8 s timer here makes the verify wait on its own
proof. Exercise the real timer with a new reader and a partly elapsed
interval as well as release after cancellation and failure.

Signed-off-by: Adrian Rangel <adrian@acrogenesis.com>
The J316c journal records an established registration, a successful
CLEAR_STATE and a REGISTER_SERIAL reply of 0x16 26 to 33 ms after
power-on. The session model previously stopped as it processed the
clear. Record successful clears and the status of the serial operation
itself, and leave the state established on refusal. A persistent refusal
in the fixture exercises fresh registration on the third attempt.

Exercise the actual T6000 registration method and SBIO reply handler in
the host verify test too. A refused serial must return to the retry loop
without entering capture, and the successful attempt must use the fresh
registration sequence before the one comparison.

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>
The host runner enumerates each Python suite. Register the enrolment fixture so CI exercises cancellation, exhausted retries and single-attempt profiles on subsequent changes.

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

Copy link
Copy Markdown
Member Author

Thanks, Naeem. The T6000 profile now selects the enrollment and verification retry policies in the same way. On exhausted retries, both paths idle and power down the sensor before returning a failure. A cold restore proof also powers it down, but it takes no image, so it no longer starts the 1,800 ms capture delay. A preceding capture still gets its remaining settle time.

I checked the original M1 Max journal. CLEAR_STATE succeeded and REGISTER_SERIAL returned 0x16 at 26, 30 and 33 ms after power-on, on three separate requests. The new test drives the serial refusal after a successful clear. It fails if the third attempt keeps using the old registration. The host test also checks that no capture starts before registration succeeds.

I built f0956f34f2b0 in ARM Lab and booted that image in diskless ARM KVM. All 123 SEP KUnit cases passed, including t6000_verify_retries_register_serial_0x16_from_fresh, and all five focused host tests passed. I also added the enrollment startup suite to the official CI manifest and verified the runner discovers and passes it. The module advertises t6000_registration=1 so the Mac package can check that both fixes are present.

I kept the original commits from both PRs for attribution and added the rationale to the PR description and follow-up commit bodies. The physical M1 Max results are still the ones on the earlier combined build. A new J313 run remains open after the Wi-Fi module staging failure.

@malik-na

Copy link
Copy Markdown
Member

Tried the M1 Air again at f0956f3. It still doesn't stage, and the cause isn't this PR.

Mac Build Result
J313 / T8103 (MacBook Air M1) f0956f3 (7.2.11-labf0956f34) not booted: initramfs build fails, module not found: 'mt7932_fullmac'

The Air's omarchy-aurora-firmware (20261014-8) mkinitcpio hook aurora-vendor-order adds mt7932-fullmac without a check. That's the Neo's Wi-Fi driver, not the Air's, but the hook wants it on every Mac. A 7.2.11 kernel off integration/aurora doesn't have it, so no kernel from this base can stage on the Air. So there's no J313 result yet. Touch ID enrolment and matching weren't run either way.

omacom/linux-aurora is frozen now. Kernel work moved to aurora-silicon/linux on 17 Nov. Could you bring this series over there? It would be on a 7.3 base, which ships mt7932-fullmac (the Air's 7.3.0-1-1-ARCH has it), so it should stage on the Air. Please drop the merge commit (c79c7c7) when you move it.

@acrogenesis

acrogenesis commented Nov 30, 2026 •

Copy link
Copy Markdown
Member Author

Thanks for testing the Air, Naeem. The 7.3 port is open against the new kernel repository’s main branch. It omits the merge commit and uses the current driver’s registration and match handling. At e61ffc7e9, all 347 Apple SEP KUnit tests passed in diskless ARM KVM. The new revision still needs physical enrollment, verification and a match after reboot. Replacement PR

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