Skip to content

soc: apple: sep: let SEP_BIO_REARM end only the wait after boot - #3510

Merged
RyanTheTide merged 1 commit into
mainfrom
fix/sep-rearm-boot-wait-only
Nov 28, 2026
Merged

RyanTheTide merged 1 commit into
mainfrom
fix/sep-rearm-boot-wait-only

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

What

After a restart Touch ID waits for the first password (SEP_BIO_REQUIRE_PASSWORD). That wait belongs to the machine: on macOS the login password also enables Touch ID for a finger added later in the same boot. Userspace could only end it with SEP_BIO_REARM, which also ends a lockout and clears failed matches. So the re-arm helper had to refuse the password of an account with no enrolled finger, and Touch ID stayed off after that account enrolled its first finger, until a second password (aurora-silicon/aurora-sep-userspace#47).

This adds SEP_BIO_REARM_FLAG_BOOT_WAIT_ONLY in the old reserved word of struct sep_bio_rearm. With it, SEP_BIO_REARM ends only the after-boot wait and hands the saved lockout record to the enclave, as after any first password. A lockout, the failed matches and the record stay as they are and still need the plain SEP_BIO_REARM after an enrolled account's password. The check and the change happen in the one request, so state that userspace read earlier can't go stale (that was the blocking finding on aurora-silicon/aurora-sep-userspace#48). Older kernels refuse a nonzero reserved word with -EINVAL, so a helper that asks for the flag fails closed there.

Userspace: aurora-silicon/aurora-sep-userspace#48 (needs this; without it the print-less path is refused).

Tested: J616s T6040 at 04da8bb pass (one-shot 7.3.0-aurora-tidarm1 = main 00fbe80 + this commit, fleet89 config, default cmdline, Enforcing, 0 failed units, 0 AVC). Boot wait plus a lockout restored from a locked record: a print-less gdm-password ends the wait and the lockout stays (record unchanged). The next print-less password is refused, and the enrolled account's password then clears the lockout through the plain REARM. Boot wait alone: a wrong password keeps it, a print-less gdm-password arms Touch ID, and a verify then starts a capture. Back on fleet89 (no flag), the same helper gets EINVAL and the wait stays.
Risk: two-way (new uapi flag in a reserved field; old userspace sends 0 and sees no change). Macs: every Touch ID Mac (J616s, K114s, J413).

Not yet

  • KUnit sep_rearm_request was updated (flag accepted, unknown bits refused). Built with the trial kernel, not run on hardware (no on-hardware KUnit).
  • K114s GNOME finger flow (fresh boot, password login, enrol in Settings, lock, unlock with the finger) once both PRs are in a build.
Details
  • bio.rs: read_rearm returns {password, boot_wait_only}; any flag bit other than SEP_BIO_REARM_FLAG_BOOT_WAIT_ONLY is -EINVAL.
  • sbio.rs: end_boot_wait_after_password() does bio_after_boot.xchg(false) and the usual import_lockout_after_password(). It never touches the lockout, failure count or record. Admin only, like REARM.
  • Logs: apple_sep: Touch ID: armed by the first password since this boot (an account with no fingerprints yet; a lockout, if any, stays).
  • Evidence (lab store): traces/touchid/20261128-touchid-arm/v4/ (pre/trial/post logs + scripts, README).
  • Non-author adversarial review of the userspace side: REVIEW6 on aurora-sep-userspace#48 (its CHANGES REQUESTED is what this kernel change answers); re-review requested for both.

After a restart Touch ID waits for the first password (SEP_BIO_REQUIRE_PASSWORD).
That wait belongs to the machine, not to a fingerprint: on macOS the login
password enables Touch ID for fingers added later in the same boot. The
re-arm helper could only end it with SEP_BIO_REARM, which also ends a lockout
and clears failed matches. So it refused a password of an account with no
enrolled finger yet, and Touch ID stayed off after that account enrolled its
first finger, until a second password.

Add SEP_BIO_REARM_FLAG_BOOT_WAIT_ONLY in the request's reserved word. With
it, SEP_BIO_REARM ends only the after-boot wait and hands the saved lockout
record to the enclave, as after any first password. A lockout, the failed
matches and the lockout record are left as they are, and still need the plain
SEP_BIO_REARM after an enrolled account's password. The check and the change
happen in the one request, so state that userspace read before cannot go
stale. Older kernels refuse the flag with -EINVAL, so a helper that asks for
it fails closed there.

Signed-off-by: Ryan Murray <[email protected]>

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: MERGE at 04da8bb after required checks and coordinated qualification.

Checked: The ioctl size and number are unchanged, unknown flags reject, and both dispatches retain the admin check. Boot-only dispatch clears the boot latch and runs the existing record import; it never calls the general reset or writes the lockout record. The paired J616s row reports that the recorded lockout survives and the enrolled password still clears it through the old operation. Run hosted KUnit and retain peer qualification before rollout.

RyanTheTide added a commit that referenced this pull request Nov 28, 2026
@github-actions github-actions Bot added area:platform Area from CODEOWNERS (bot) door:two-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Nov 28, 2026
@github-actions

github-actions Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Merge readiness at 04da8bbd: not ready yet

Check Detail
CI at head running running: KUnit macsmc, KUnit clpc, KUnit apple-spmi-nvmem, KUnit trusted-keys
Review no needs one approving review from Core or Omarchy Mac (not the author)
Requested changes ok none
Hardware row at head ok in the PR body at 04da8bbd
Conflicts ok none
PR text ok Risk: two-way · (new uapi flag in a reserved field; old userspace sends 0 and sees no change). Macs: every Touch ID Mac (J616s, K114s, J413).

Areas: area:platform

Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels.

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

code-owner ping <@422957901716652033> / @DjDeveloperr: merge train at 04da8bbd. App approved, J616s row PASS at this head. The SEP path is shared by every Touch ID Mac, so this also needs one second-family row (J413 or K114s: boot wait plus one fingerprint unlock, lockout unchanged). It merges under the 6-point rule after that row and green CI, unless you object.

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Second-family hardware row at 04da8bb: J413 (M2 Air, T8112), with aurora-sep-userspace#48 at a1b94070. It is a one-shot boot of this head on the fleet89 config; the default kernel is unchanged.

  • Boot wait set; a print-less account's local password (gdm-password) ends only the boot wait. A lockout restored from the record stays, and the record is unchanged.
  • A second print-less password is refused. An enrolled account's password clears the lockout through the existing REARM.
  • A wrong password, the account's own uid calling the socket, su and polkit all keep the boot wait.
  • After the arm, fprintd-verify on an account with real prints starts a capture instead of verify-password-required-after-boot.
  • On fleet89 (without this change), the new helper gets EINVAL and the wait stays (fails closed); an enrolled account still arms.
  • Enforcing, 0 AVC, 0 failed units; the machine was restored afterwards.

This matches the J616s (T6040) row.

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Merging under the 6-point rule (Ryan 09:29, permanent), at 04da8bbd. (1) The review App approved at this head. (2) Full CI is green. (3/4) Rows: J616s+J413. (5) There's no blocking review. (6) Dj was pinged here 256 min ago with no objection. Revert: git revert -m 1 <merge>.

@RyanTheTide
RyanTheTide merged commit f7d2711 into main Nov 28, 2026
27 checks passed
@RyanTheTide
RyanTheTide deleted the fix/sep-rearm-boot-wait-only branch November 28, 2026 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:platform Area from CODEOWNERS (bot) door:two-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant