Skip to content

soc: apple: sep: Bound xart_guard_pins by board and setup operation - #528

Open
acrogenesis wants to merge 3 commits into
omacom:sep/xart-guard-pin-j313from
acrogenesis:fix/sep-guard-review
Open

acrogenesis wants to merge 3 commits into
omacom:sep/xart-guard-pin-j313from
acrogenesis:fix/sep-guard-review

Conversation

@acrogenesis

@acrogenesis acrogenesis commented Nov 27, 2026 •

Copy link
Copy Markdown
Member

This proposes fixes directly onto Naeem Malik’s storage-guard branch for #506. Merging here updates that PR. Poul Guo Skov’s original pinning commit and Naeem’s full series remain in its history.

On the M1 Air (J313), provisioning can pin two existing records. The third can be admitted only while the driver is performing the first activation after a successful guarded create. There is no open admission window while the machine waits for a user to open the reader. On J314s, J316s and J316c, the measured allowance is one provisioning record. J293 can reuse its previously recorded pins. Its published hardware report does not establish a count for a fresh setup. Every board still needs the normal guard checks before any pin is allowed.

A completed setup records the UUID of the committed identity. A spent marker alone cannot establish that the active identity was created under the guard. Upgraded installations with a valid older pin list get a separate diagnostic state; a successful real match can confirm the older identity for the current boot. A refusal always takes precedence. The package can check the driver’s advertised capability before loading it and its effective policy once it is running.

Evidence

  • The archived first enrollment on our 16-inch M1 Max (J316c, OS firmware 13.5) pinned one record, reused it, and completed with zero guard refusals on the earlier guarded Stable backport. M1 Max hardware report
  • Other board evidence comes from the J313 trace in the parent PR and the J314s, J316s, and J293 reports.
  • The J313 success that can be traced to a specific commit is on d7cbd45fe. A later, narrower window failed on that Air. The reviewer’s most recent staging attempt could not find mt7932_fullmac. First-time hardware qualification of this revision is still open. Commit explaining both J313 runs

The diagnostic ABI is now version 3. The package can use xart_guard_pins_abi=1 before insertion, then check the effective xart_guard_pins value on the running device. The keybag writer syncs both the intent and its directory before asking the enclave to create the identity.

The final patch also requires the complete canonical refusal record before the driver may attempt another create. A partial or damaged record keeps the current identity intact. For 4beecf0d7327, all 142 SEP KUnit cases passed, including the new keybag refusal test. The guard changes also passed the focused host and packaging tests. The packaging-only follow-up a352e2d2b279 verified all 11 Arch source checksums with makepkg --verifysource. The KUnit image was built in ARM Lab and booted in diskless ARM KVM. The branch also merges cleanly with #525. The combined tree passed all 143 SEP KUnit cases. A separately built combined module exposed both capability tags and loaded in a diskless guest with writes and provisioning disabled. The Mac package accepted that ELF on the J313 and J316c fixtures and rejected the preserved earlier guarded module.

The hardware evidence above belongs to the original work. This revision still needs a physical first setup, match and restart. Thanks to Naeem, Poul, Marcelo Alcantara (@maralcbr) and the testers on each board.

Limit pin admission to measured provisioning operations and the first
guarded J313 activation. Keep the guard closed between them. Make the
keybag intent durable before sending the create and record the committed
identity separately from a spent attempt.

Report the running pin policy and give a storage refusal precedence over
every matching update. Reuse bounded legacy pins without inferring
guarded creation. A verified match with saved state can establish
usability for that boot.

Signed-off-by: Adrian Rangel <adrian@acrogenesis.com>
@greptile-apps

greptile-apps Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Confidence Score: 5/5 · The checksum fix appears safe to merge.RetriggerView in GreptileConfidence Score: 5/5

[High impact] The checksum fix appears safe to merge.

Summary

Bounds shared-record pins by board and setup step, ties guarded completion to the saved keybag UUID, and adds diagnostics for older installations.

  • Cold-boot Macs get board-specific limits on which setup steps can pin xART lockers.
  • Keybag setup records survive crashes before creation, and retries require a complete refusal record.
  • SEP diagnostics distinguish older pinned setups from confirmed guarded identities.

Reviews (3) · Last reviewed commit: "tools: aurora-sep: update Arch safety do..." · Reviewed by Greptile

Only the complete, empty v2 refusal record means a previous create did
not leave a bag. Compare with the record the writer encodes. Reject a
damaged header or length before it can authorize another CREATE_KEYBAG.

Signed-off-by: Adrian Rangel <adrian@acrogenesis.com>
Comment thread tools/aurora-sep/XART-SAFETY.md Resolved
Signed-off-by: Adrian Rangel <adrian@acrogenesis.com>
@malik-na

Copy link
Copy Markdown
Member

@acrogenesis, I closed #506, which this PR targets. This repo is frozen, and aurora-silicon/linux has the M1 xART guard off by default (aurora-silicon/linux#1049). Thanks for the race fix and the rework. I'm leaving this PR for you to close or carry over, whichever you prefer.

@acrogenesis

Copy link
Copy Markdown
Member Author

Thanks, Naeem. I’m keeping this branch available as a reference for the guarded 7.2 work. The registration port for 7.3 is separate. A guarded enable path on the new kernel would need to account for the new M1 default and the removal of the read-only controls. The Mac package still requires a compatible guard before enabling Touch ID on these models. 7.3 registration PR · Mac package PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants