Repository navigation
Conversation
`install -d -m 0700 /run/t2-touchid/workers` applies the mode only to the leaf, so a fresh Linux-native install created the parent as 0755. The only other creator of the parent with 0700 is t2-keybag-load.sh, which is disabled in Linux-native mode, and fprintd.service's RuntimeDirectory=t2-touchid/workers also creates the parent as 0755 at boot. t2-native-first-run then stopped with "replacement runtime directory is not root-private". Create the parent explicitly as 0700 in the installer and add a tmpfiles.d entry so it is root-private before fprintd starts on every boot. Observed on MacBookPro15,1, linux-t2 7.3.4, fresh Linux-only install. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Linux 7.3 removed struct acpi_driver, and T2 kernels now bind the SMC (APP0001) to the macsmc MFD stack (macsmc-acpi, -hwmon, -power, -rtc, -wdt). The bundled applesmc-t2touch prerequisite no longer compiles, and even a ported applesmc would contend with macsmc for the same device. The macsmc core exposes /dev/smc with key read/write/info ioctls, so the one-shot EFMV/EFMS/EFBS boot-state transaction can run from userspace: - src/t2-smc-boot-state.c performs the same transaction as the applesmc patch (pristine EFMV check, bridgeOS version from DMI, EFMS clear, EFBS commit, 40 s EFMS poll) and records the result in the existing vocabulary at /run/t2touch/t2_sep_boot_state. --probe is read-only. Runs at most once per boot; commit-uncertain is never retried. - t2-smc-boot-state.service runs it sandboxed to /dev/smc, ordered before t2-sep-transport.service. udev starts it when /dev/smc appears, because misc devices are not visible to systemd and a device dependency would time out (and delay boot on applesmc kernels). - The installer detects macsmc (character /dev/smc plus macsmc-acpi bound to APP0001), installs the helper, unit and udev rule instead of staging applesmc DKMS, skips the applesmc modprobe options/softdep, and reads the userspace result alongside the sysfs attribute. applesmc kernels are unchanged. uninstall.sh removes the new files. - Tests stub macsmc detection so they stay hermetic on macsmc hosts, and cover the macsmc gate, detection and result reading. Verified on MacBookPro15,1 (J680, bridgeOS 23.16.15067.0.0,0), linux-t2 7.3.4, Linux-only: response-received:1, first-run identity created, finger enrolled, sudo authenticated by Touch ID. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
A heads-up from a MacBookAir9,1 on Ubuntu. On linux-t2 7.3.4-3 the helper's probe works here too, but 7.3.5-1 closes the /dev/smc route. The patch set changed on 2026-11-17 (linux-t2-patches 60a3b5e):
I checked both in the 7.3.5-1 package (the header and macsmc-core.ko), not on a running 7.3.5. I went another way: a small kernel module that runs the same transaction through |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
On Linux 7.3 T2 kernels, the installer can't satisfy the applesmc boot-state prerequisite, so fresh installs stop before any product setup. This PR moves the one-shot EFMV/EFMS/EFBS boot-state transaction to userspace, through the macsmc
/dev/smcinterface. It also fixes a/run/t2-touchidpermission bug found during the same install.Two commits, which can be reviewed or merged separately:
cfeb917Keep /run/t2-touchid root-private on Linux-native installs: 2 files, +6 lines. This applies to any kernel.ec22e05Publish the T2 SEP boot state through macsmc on Linux 7.3+: 8 files.Problem
macsmc replaces applesmc. Linux 7.3 removed
struct acpi_driverandacpi_bus_register_driver(). T2 kernels (seen on linux-t2 7.3.4) now bind the SMC (APP0001:00) to the macsmc MFD stack:macsmc-acpi,-hwmon,-power,-rtcand-wdt. Effects:packaging/applesmc-t2touchfails to compile ('struct acpi_driver' has no member named 'drv', implicitacpi_bus_register_driver).macsmc-acpifor the same device. On this machine, macsmc also supplies the battery and ACpower_supplydevices.applesmc-t2touch DKMS build failed./run/t2-touchidis world-readable on fresh Linux-native installs.install -d -m 0700 /run/t2-touchid/workersapplies the mode only to the leaf directory, so the parent is created 0755.t2-keybag-load.shis the only other creator of the parent as 0700, and it is disabled in Linux-native mode.fprintd.service'sRuntimeDirectory=t2-touchid/workersalso creates the parent as 0755 at boot.t2-native-first-run.servicestops withreplacement runtime directory is not root-private.Change
Boot-state publisher (macsmc kernels only)
src/t2-smc-boot-state.cruns the same transaction aslinux_native/patches/applesmc-t2-sep-boot-state.patch, through theIOCTL_SMC_GET_KEY_INFO,IOCTL_SMC_READandIOCTL_SMC_WRITEioctls on/dev/smc:fefollowed by zeros).0x11, then polls EFMS for up to 40 s.response-received:N,rejected,failed,commit-uncertain,not-applicable) at/run/t2touch/t2_sep_boot_state.commit-uncertainresult is never retried.--probeis read-only.T2_TOUCHID_SEP_EPOCH_MAJORandT2_TOUCHID_SEP_EPOCH_MINORfrom/etc/t2-touchid.confoverride it.systemd/system/t2-smc-boot-state.serviceis a oneshot ordered beforet2-sep-transport.serviceandt2-biometric-port-refresh.service.DevicePolicy=closedwith only/dev/smcallowed, no capabilities,PrivateNetwork=yes, andRuntimeDirectory=t2touch(preserved).[Install]section.udev/90-t2-smc-boot-state.rulesstarts the unit when/dev/smcappears.dev-smc.devicenever activates, and a dependency on it would time out.tools/installer-kernel.sh:macsmc_activerequires a character device at/dev/smcandmacsmc-acpibound toAPP0001:*.ensure_applesmc_on_diskinstalls the helper, unit and udev rule instead of staging applesmc DKMS.absentpath skipsenable_applesmc_next_boot.applesmc_boot_resultalso reads the userspace result. If both a sysfs result and the userspace result are present, the outcome isambiguous, which fails closed as before.install.sh: on macsmc kernels it does not write the applesmcoptions/softdepfile. That softdep would makemodprobe t2_sep_transportpull the in-tree applesmc in next to macsmc.Permissions fix
install.shcreates/run/t2-touchidas 0700, andchmods it if it already exists, before creatingworkers.systemd/tmpfiles.d/t2-touchid.confaddsd /run/t2-touchid 0700 root root -.Files T2Touch now owns
/usr/local/sbin/t2-smc-boot-state/etc/systemd/system/t2-smc-boot-state.service/etc/udev/rules.d/90-t2-smc-boot-state.rules/run/t2touch/t2_sep_boot_state(runtime)/run/t2-touchidmode, via the existing tmpfiles fileuninstall.shremoves the first three and reloads udev. It also removes thesysinit.target.wantslink that an intermediate revision of this branch created. Reinstalling overwrites only these files.Hardware risk
Kernel/SMC boundary, writes. The helper writes the same three SMC keys, with the same values and preconditions, as the existing applesmc patch, through a different driver. It writes nothing unless EFMV is pristine. On failure it records a status, and boot continues.
Tests
python3 -m unittest tests.test_installer tests.test_installer_kernel: 50 tests OK.macsmc_activeandensure_macsmc_publisher, so the tests stay hermetic on macsmc hosts. Before this change they failed there.ambiguouswhen the sysfs attribute is also present).python3 -m unittest discover -s tests, 1502 tests. The same 27 errors occur on the unmodified base5934b05; they come from Python dependencies absent outside the venv. No new failures.tools/privacy-check.shandenrollment_research/scripts/check-public-tree.shpass.systemd-analyze verifyandudevadm verifypass.-Werrorhardening flags.Hardware observations
Platform: MacBookPro15,1 (J680AP), bridgeOS
23.16.15067.0.0,0, linux-t27.3.4-arch1-2, Omarchy, Linux-only (no Apple partitions), fresh install,T2_TOUCHID_AUTHORITY_MODE=linux-native.t2-smc-boot-state --probe(read-only): EFMV is 32 bytes with flags0xc4, EFMS is 1 byte (ui8,0xc0), EFBS is 1 byte (ui8,0xd0). EFMV readfe 00…(pristine).response-received:1.226/NAMESPACEbecause of aReadWritePaths=on a missing/run/t2touch; this is fixed byRuntimeDirectory=. That failure happened before the helper executed, and a re-probe confirmed EFMV was still pristine before publishing.systemctl start) after that fix.received T2 SEP boot-policy response 1 for bridgeOS 23.16.15067.0.0,0 epoch 1.00.21 s later.t2-native-first-runandfprintdcame up active, andt2-touchid-statusreportedreadywith the enrolled finger intact.01before the transaction (stale) and the response arrived within milliseconds. I can't fully rule out reading back the stale value, but readiness was proven independently by the service chain below.t2-sep-transport,t2-biometric-ready,t2-native-first-runandfprintdare active.t2-native-first-runsucceeded after the permissions fix (before it, it stopped withreplacement runtime directory is not root-private).t2-touchid-enrollenrolled 1 finger, andt2-touchid-statusreportsTouch ID service: ready.sudo -k && sudo trueauthenticated by Touch ID with no password typed. fprintd loggednative_matchoutcome: ok,request_total10.7 s including the wait for the touch.fprintd-verifywith an unenrolled finger returnedverify-no-match (done), exit 1. The native match request completed normally (request_total11.2 s, including the wait for the touch) and the verdict was a rejection.Not verified
sudo: the wrong-finger test went throughfprintd-verify, not throughsudo/PAM.External, not changed here
Recovery
./uninstall.shremoves the publisher files.commit-uncertain, the helper refuses to retry until reboot, and the existing gate stops installation before product setup.🤖 Generated with Claude Code