Repository navigation
Conversation
…ed key store A write the guard refuses while the key store is created leaves the enclave unanswering until a restart, which setup reported only as a node that never appeared. A kernel without omacom/linux-aurora#212 also leaves the creation's intent record, so every later setup fails; setup now says so and stops, and leaves the record alone.
…nd after an agreement The status now records the unfinished creation instead of failed, so a second setup that boot doesn't offer a retry, and a Mac whose agreement survived the hung creation is told why too. A refused creation's record holds no key store, so the consent no longer says one is reused.
[Medium impact] The code appears safe to merge, subject to the kernel-owner approval already requested by the author. SummaryTouch ID setup now explains when the xART guard refused a write and when an unfinished key store prevents another setup attempt.
Acknowledged by
|
scottjones
left a comment
There was a problem hiding this comment.
Thanks, this is a big improvement over "never appeared" for the #209 case. We ran omarchy-mac/test/all on 49c0622 (112 ok). Reverting each of touchid-eligibility, touchid-enable, touchid-activate and enable-fingerprint on its own makes a new case fail, so the tests cover each change. A committed record (state 1 or 3), a v1 or foreign header, and an empty or short file all still read present/available, so a working M2 Max like ours sees nothing new. Consent and the lock are untouched: unsupported:unfinished-keybag exits before the prompt, and touchid-enable checks it under the lock before anything loads. Three things before merge:
-
"Won't work" may fire on a creation that's still running.
omarchy-mac/lib/touchid-enable:165waits 20 s for the node and the keybag. The driver writes the state 0 intent record before it sendsCREATE_KEYBAG, so the keybag file exists as soon as the create starts, and from then on the loop just waits on the node. If the node is still missing at 20 s, lines 194-195 and 213-214 treat any state 0 record as stuck: they recordunsupported:unfinished-keybagand tell the owner setting it up again won't work. A slow bring-up whose create is still running at 20 s looks exactly the same at that moment, and the test atomarchy-mac/test/touchid-consent-test.sh:498covers that case as intended behaviour. Before this PR that case said "failed, restart before trying again", which was right if the create finished later. It isn't a stuck Mac:fail()takes the agreement back, and after a restart the record has committed and Touch ID is offered again. But the owner is told it won't work and loses a boot. Could the stuck verdict also require the driver to say the create failed?diag/keybagreadsunknownuntil provisioning returns andfailedonce it gives up, so it tells the two apart. Otherwise fall back to the old restart message. -
The #212 wording is out of date. linux-aurora#212 merged with the retry for xART-refused creates reverted (06cf15d0f, "No retry after a refused create"). On the merged kernel, a create the guard refuses keeps its state 0 intent and stays
EEXIST. State 2 only comes from an unsent create or a non-zero enclave status, and both already existed. So the comment atomarchy-mac/lib/touchid-enable:207, the test comment atomarchy-mac/test/touchid-consent-test.sh:467, the README line ("A kernel with omacom/linux-aurora#212 marks that creation retryable") and the PR body all describe something that didn't ship. The code still does the right thing, because a refusal lands on the "won't work" branch. But the "safety check refused a write while the key store was being created ... Restart, then set up again" branch at line 212 now fires only when refusals happened and the record isn't state 0. That isn't the case it describes. Could we reword it, or narrow it to the state 2 case? -
Minor: an agreed Mac over an unfinished record stays turned on. At
omarchy-mac/entrypoints/enable-fingerprint:49-52the agreement and options stay, soomarchy-mac-touchid-load.servicekeeps loadingapple-sepwithxart_writes=1 provision_keybag=1at every boot, and it can never come up. The message says Touch ID is turned on but can't come up, but not how to turn it off: removing the fingerprint (disable-fingerprint) drops the options so the driver stops loading. A line saying so would help. This only reaches a Mac whose agreement outlived the failed create, sincetouchid-enabletakes a new agreement back when it fails.
On merge order: this merges cleanly with main and with #61, but it conflicts with #69 in touchid-eligibility (both add a check just before echo available) and in touchid-consent-test.sh. Both conflicts are mechanical. We'd land #61, then this, and have #69 rebase. This PR also asks for Chris's opt-in on reading the kernel's keybag header, and we agree that should come first.
|
Prepared a merge of current main ( I cannot push to this PR's omacom-owned source branch (GitHub returned 403). A maintainer can fast-forward The resolution keeps main's short Touch ID warning and the detailed manual, while retaining this PR's unfinished-keybag checks and diagnostics. The prompt tests now follow the short warning. The keybag fixture remains behind the eligibility helper; the display-only path is no longer rewritten to a long temporary path that falsely trips the 80-column check. Checks on the resulting tree:
This update resolves the main conflicts only. It does not address the existing review points about a still-running create at the timeout, the outdated #212 retry explanation, or removal advice for an already-agreed Mac with an unfinished record. The requested opt-in on reading the keybag header is also still outstanding. No hardware qualification or release is claimed. |
|
Refreshed again onto current main Pushing to The merge was clean. It keeps this PR's unfinished-keybag checks together with main's current display-wait and boot-check tests. Local checks, all exit 0:
Same limits as the 2026-11-05 note: this does not answer the open review points, and it claims no hardware qualification. |
Summary
Touch ID setup now says when the xART guard broke it (omacom/linux-aurora#209) instead of the generic "
/dev/sep-bionever appeared". On kernels without omacom/linux-aurora#212 it also recognises the unfinished key store record that refusal leaves, explains it and stops. It never moves or deletes that record.The unfinished-record handling is option B from a debate with GPT-6 Astra: explain and stop, print no move-aside command. Kernel
keybag.rstreats a state-0 record as "a bag may exist unnamed", so removing it could strand a key store the enclave holds. READMEfingerprint-readersupdated.Evidence
diag:keybag=failed touchid=failed xart_guard_refusals=1. Setup printedthe Secure Enclave driver loaded but /dev/sep-bio never appeared; see journalctl -k for apple_sep. On aurora4 every later setup then failed withEEXISTand gave the same message.After:
omarchy-mac/test/allin an aarch64 Arch Linux ARM container: 112 ok, 0 not ok. New cases:unsupported:unfinished-keybag, which an update in the same boot keepsmodprobeand leaves the record byte-identicalmainfor every touched file.Merge Danger
Door: two-way
Messages and one new
unsupported:reason only. Nothing writes or removes the keybag record. Reverting restores the old messages.Blast Radius: Touch-ID-setup
Touch ID isn't released yet (edge only). New coupling: userspace now reads the header of
/var/lib/aurora-sep-keybag.bin(magic, version 2 at0x10, state at0x14), which is the kernel driver's private format, and state 2 isn't merged until omacom/linux-aurora#212 lands. This needs Chris's opt-in as kernel owner before merge. A kernel that changes the format makes the check fall back topresent, so it reports nothing new and never blocks setup. The runtime needs no change: the detector ignoresunsupported:reasons.