Repository navigation
Offer guarded Touch ID on the 16-inch M1 Max MacBook Pro - #202
acrogenesis wants to merge 14 commits into
Conversation
touchid-eligibility admits apple,j313 on apple,t8103; the other M1-family boards (J293, J274, M1 Pro and Max) still read unsupported:m1-family. On the J313 the first setup rewrites a key-store session record macOS created, which the driver's xART guard refuses (omacom/linux-aurora#223: "refused to rewrite a kind-4 record this Linux install did not create", then CREATE_KEYBAG fails). The new lib/touchid-options prints the driver options both writers use (touchid-enable and enable-fingerprint) and adds xart_guard=0 on the J313 only, so the owner's agreement loads the driver with the guard off there and nowhere else. The README and the manual's Touch ID section say so. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
touchid-options now gives the J313 xart_guard_pin=1 (omacom/linux-aurora#486) in place of xart_guard=0. On the J313 the first setup rewrites three pre-Linux kind-4 lockers, two at the keybag's COPY_KEYBAG and one at the first activation's LOAD_KEYBAG; with the window held through the first activation and room for three pins, setup, enrol, match and a reboot restore pass with xart_guard_refusals 0, and the guard keeps every other macOS record. #486 as posted pins one locker around CREATE_KEYBAG only and fails on the J313; the changes it needs are reported there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From the review of omacom#162: - touchid-eligibility records unsupported:kernel on the J313 unless `modinfo -p apple_sep` lists xart_guard_pins (omacom/linux-aurora#506). A kernel with #486's xart_guard_pin pins one locker at the create and cannot finish the setup; a built-in driver lists no parameters and is refused too, so the one-time invitation never leads to a setup that cannot finish. - touchid-options writes xart_guard_pins=1 on the J313. - Before loading on the J313, touchid-enable sets aside an earlier try's guard list and uncommitted keybag (anything without the driver's magic and a committed state) in /var/lib/aurora-sep-touchid-retry-<time>/, so the pin window opens again after a try that failed on an older kernel. A committed keybag keeps its list; any failed move fails the setup. - Tests: the kernel check against #506, #486 and parameter-less kernels; the set-aside for a list, a header, both, an unwritten file and a committed keybag; the M2 Max's options carry no pin. The manual says Touch ID is offered on the M1 Air only with such a kernel. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…thout the pins - The set-aside of an earlier try's guard list and uncommitted keybag moves into lib/touchid-retry-aside, which touchid-enable calls before loading as before. - enable-fingerprint's agreed branch calls it too, under the Touch ID lock, when the activation recorded a status that isn't ready and is not running now. A setup that crashed between the agreement and the load, or one whose spent state ends at failed, not-ready or blocked, is set aside so the restart sets it up again. With no status recorded the setup may still be running and nothing moves; the agreement and the status are re-read under the lock. - On a kernel whose driver has no xart_guard_pins, the agreed branch says so instead of telling the owner to restart, and moves nothing. - Tests: each recorded status, no status, an activation still running, a committed keybag and the unsupported kernel through the agreed branch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ithout the pins
- enable-fingerprint read the activation with systemctl is-active, which a
oneshot never passes while it runs ("activating"). It now sets the state
aside only when ActiveState is inactive or failed.
- lib/touchid-kernel-ready (new) holds the J313 check eligibility made:
modinfo -p apple_sep must list xart_guard_pins. The load unit runs it as a
second ExecCondition, so an M1 Air set up with the pins that boots an
older kernel keeps the driver off until a kernel with them is back.
- Tests: the systemctl stub answers show as systemd does (activating,
failed); a keybag in state 3 keeps its list; a guard list mv that fails
stops the setup before the load; the modprobe stub records a list still
in place at the load. Each of these fails on the mutation it covers.
- README and manual say the driver stays off on such a kernel.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Preserve the original M1 Air package commits and the J316c hardware candidate. Apply the four options used on the guarded hardware to the M1 setup paths while retaining main's M4 Max guard setting and PAM re-arm hooks.
[Critical impact] The changes since the previous review appear safe to merge. SummaryAdds guarded Touch ID opt-in for the 16-inch M1 Max MacBook Pro alongside the M1 Air.
No actionable new issues were found in the changes since the previous review. No previous review threads were supplied. This review did not run tests or verify physical hardware.
|
|
Review and hardware test at 865916f. Code review
Questions the review could not settle from the code:
CI at this head: 6 passed, 0 failed, 0 pending. Not tested: no hardware boot; Touch ID enrolment and matching (the lab boot does not scan a finger). |
|
Thanks, Naeem. I pushed Boot and setup serialize recovery. An The exact head passed 134 package and 62 pinned-runtime integration checks. In ARM Lab the real setup command also stopped before D-Bus discovery when the owner hook reported an unsafe reader. The same running-driver check protects fprintd when a request comes from PAM or another D-Bus client. Custom module settings survive a failed attempt or opt-out. The package also removes writable M1 arguments from the automatic load path. If the kernel only supports the older #180 behavior, it can still load SEP read-only for the microphone. Driver and activation checks no longer infer that a module is safe just because four parameter names exist on disk. On the physical M1 Max, the earlier Stable userspace backport completed enrollment and matching. Reliable verification after reboot used #525 as well as #506. The exact package revision here was tested through the owner entrypoint and service fixtures; it has not performed fresh provisioning on this Mac. We also built the two proposed kernel changes together: 143 SEP KUnit tests passed, both module tags were present, and the package accepted that actual ELF on both board fixtures. |
|
Re-review at d52a4b9. I read the code only and did not run it on hardware. My M1 Air was busy with another job. Earlier findings
Left over
The J313 hardware check is still to come. Otherwise this looks good to me. |
scottjones
left a comment
There was a problem hiding this comment.
Thanks Adrian, this round fixes everything I raised last time. Reading the running driver on both boards, and moving the set-aside into touchid-load under the lock, makes this much easier to trust.
The code looks right to merge once the two tests in point 1 are fixed. The merge or release should still wait for Naeem's J313 hardware check and a published kernel with omacom/linux-aurora#528 and #525.
1. Two safety checks pass their tests for the wrong reason
The code is right in both places. The tests just don't prove it.
a. omarchy-mac/test/touchid-consent-test.sh:314-319 sets diag/xart_guard and then diag/xart_guard_pins to 0 before any saved build id exists, so touchid-kernel-ready exits 2 on the missing build id either way. I tried removing the xart_guard == 1 condition at omarchy-mac/lib/touchid-kernel-ready:64-65, and separately the xart_guard_pins == 1 one, and the whole suite still passed. Writing the matching build id first, then setting guard and pins to 0, would make each case test what it says.
b. omarchy-mac/lib/touchid-retry-aside:35-41: I tried accepting any 32 bytes in place of the digest list, and separately dropping the 32-byte size check, and the tests still passed. A case where a different 32-byte list sits next to a refused keybag and has to stay in place would cover both.
2. Reader mode can keep fprintd off on other boards (omarchy-mac/lib/touchid-kernel-ready:22-29)
Reader mode exits 1 for any board outside the guarded, M1 and other-Touch-ID lists before it looks at the running driver. So with a read-only apple_sep loaded and /dev/sep-bio present on, say, a J504 or J614s, the new ExecCondition in fprintd.service.d/50-omarchy-mac-touchid.conf:9 fails and fprintd doesn't start, which takes USB fingerprint readers down with it. That can't happen on today's kernels, since the driver has no module alias for apple,sep, but it becomes real once omacom/linux-aurora#180's autoload lands. Could reader mode fall through to the diag/xart == disabled check on any board?
3. I agree with Naeem's two leftovers in his re-review: the build-id message in touchid-load:111-113 (not unsafe, but it gives the wrong message and withdraws consent while a writable driver stays loaded), and a comment on the udev activation race, which the systemctl start in touchid-enable:186 already covers.
4. Optional: unsupported:recovery and the manual both say the files "need inspection" but don't say what to do next. A line or two of recovery steps would help.
What looks good
- Every writable insmod needs the consent record.
- Passive loads are blacklisted, with
xart_writes=0 provision_keybag=0. - The two retry-aside digests match the two AXGO marker entries in
xart_guard.rsat #528's head (a352e2d2). - The J316c gate needs the
t6000_registrationtag from #525, so the invitation can't fire on older kernels.
Tested: at d52a4b9, omarchy-mac/test/all 134 ok, omarchy-mac-boot/test/all 309 ok, test/integration/all 62 ok (runtime omacom/omarchy 2fca7fe0), and the scope and architecture gates pass. The removal checks in point 1 were run at the same head. No hardware run.
|
I ran the helpers from this PR (head d52a4b9) on a J313 with the shipping kernel. It was read-only. I copied the PR's
What the machine looked like:
So on today's kernel a J313 can't finish the setup this PR offers. The module fails the check the PR makes mandatory. @scottjones, the J313/J316c gate you named can't be met from the kernel side right now:
That path needs redesigning against aurora-silicon/linux before this can merge. |
Signed-off-by: Adrian Rangel <adrian@acrogenesis.com>
|
Thanks, Naeem and Scott. I addressed both reviews in 060262e. The guard and pin cases now have a matching saved build ID before changing either running value. A different 32-byte record beside a refused keybag stays byte-for-byte in place. Removing each guard check separately or allowing every 32-byte record caused the corresponding test to fail. An identified Mac with a confirmed read-only SEP can now use a USB fingerprint reader. If writable insertion succeeds but the build ID cannot be recorded, setup reports that the driver is loaded, keeps consent, and blocks activation until restart. The setup code explains why it starts activation again after saving the ID. Setup and the manual also give recovery guidance. The package suite passed 134 checks and the pinned-runtime integration suite passed 62. I updated the PR description to distinguish our earlier physical enrollment from this revision. The full enable path on this revision still needs a J316c and a J313 run. Release also needs a compatible published storage guard. The new upstream kernel removed the two controls used by the read-only fallback, so a registration-only port cannot satisfy that requirement. |
The built-in Touch ID reader on a 16-inch 2021 MacBook Pro with M1 Max (
apple,j316c,apple,t6001) completed enrollment and a separate fingerprint match with the xART storage guard at level 1. This extends the owner opt-in from the M1 Air to that MacBook Pro.What changes
b9e9b2e688to9420ff4ba3, and the final merge for the integration with currentmain, including the M4 Max options and password-based Touch ID re-arm.Verification
The hardware results below are from the earlier Stable backport. The full enable path on this package revision has not been run on the physical 16-inch M1 Max (J316c) or the M1 Air (J313). The package and integration results below use fixtures.
fprintd-enrollreturnedenroll-completed. A separatefprintd-verifyreturnedverify-match (done)on the same boot. The sensor reported online, Touch ID ready, guard level 1 and zero guard refusals.linux-aurora 7.2.11.aurora14-1with the ten commits from linux-aurora#506 through56b08faee1backported onto4fdd0fc5c931. The Mac ran the corresponding userspace changes on the installedomarchy-mac 0.2.3base.availableand the four expected settings on the physical Mac. Against the extracted stock 7.2.11 and 7.3.0 modules, eligibility returnedunsupported:kernelfor both.After a subsequent reboot with the guarded Stable backport and the verification startup fix, the owner verified a saved print and added another enrollment. On this Mac the owner also unlocked the desktop and authenticated a fresh sudo request by fingerprint with password input closed. Both setup controls worked independently. Desktop hardware results.
The login screen, FileVault unlock and the 7.3 driver still need separate testing. Two pre-scan enrollment startup errors from the same boot are tracked in the combined linux-aurora PR #525. Release depends on a compatible guarded driver being published for the kernels Mac owners receive. The J316c gate requires the complete registration fix as well as the storage guard.
The earlier head
d52a4b9passed 134 package checks and 62 integration checks against the pinned Omarchy runtime. In ARM Lab, the real setup command and dispatcher exercised the owner hook with a simulated reader. The J313 and J316c probes accepted a real module built from the guarded-storage changes and #525 together. The combined kernel passed all 143 SEP KUnit cases. The package preserves custom module settings across failed attempts, upgrades and opt-out. Both the setup command and fprintd check the running reader before enumeration, including when authentication starts through PAM or D-Bus.At
060262e, 134 package checks and 62 pinned-runtime integration checks passed. Negative controls confirmed that the tests fail if either running guard check is removed or if a different 32-byte guard record is accepted. A load that succeeds but cannot record the build ID keeps the owner’s consent and blocks activation. USB reader enumeration can proceed on an identified Mac when the running SEP is confirmed read-only.Release still needs a published, compatible storage guard and hardware validation. The new Aurora kernel changed its M1 guard default and removed both read-only module controls. The 7.3 registration port covers enrollment and verification startup. This package still requires a compatible storage guard before it can enable the reader. M1 guard policy and write-control removal.
Credits
d9eee0ab1a,62f93ab0cf,e03a3b21d5,a89429e614andb9e9b2e688. Original package PR