Repository navigation
soc: apple: sep: Retry T6000 sensor registration for verification and enrollment - #525
acrogenesis wants to merge 12 commits into
Conversation
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>
[Medium impact] The changes appear safe to merge; no actionable new issue was found. SummaryAdds up to three sensor registration attempts before verification and enrollment on
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>
|
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>
|
Review and hardware test at 7043dc5. Hardware
Code review
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>
|
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 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. |
|
Tried the M1 Air again at f0956f3. It still doesn't stage, and the cause isn't this PR.
The Air's 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 |
|
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 |
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_SERIALstatus0x16within 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=1so 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
f0956f34f2b0in the ARM Lab and booted the image in diskless ARM KVM. All 123 SEP KUnit tests passed, includingapple_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 containsapple_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-ARCHkernel 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-errorduring 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 separateverify-matchon 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 resultsOn 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 reportThe 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 wasunknown. The current desktop panel changes are in Omarchy #20348.