Repository navigation
soc: apple: sep: key-store-only initrd attach, and per-user key bag unlock there (keystore_only=1/2) - #1471
Conversation
Keep host state, identity-index loading and biometric device publication off until the real root completes the original attach. Open xART read-only in the initrd, suppress keybag and ref-key provisioning, and cache trusted-key material without retaining initrd file handles. Refuse an unseal when persistent-state writes were denied, while preserving the real root's boot-policy window. Add the root-only complete_attach attribute and let load-driver finish an initrd-loaded module without another SEP registration. Cover completion rejection, retries and idempotence in KUnit, plus production cache, refusal and loader paths in buildbox host tests. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Assisted-by: LLM
SYNC_FILE selects the hidden DMA_SHARED_BUFFER symbol required by SEP. Setting the hidden symbol alone is ignored by Kconfig. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Assisted-by: LLM
Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Assisted-by: LLM
…y=2) A root volume sealed to a user's password (SEP_BIO_FDE_*) has to open before the real root is mounted, the way FileVault asks for the password once after a cold boot. keystore_only=1 attaches the key store for trusted keys only and keeps xART read-only, so a saved user bag can neither be loaded nor unlocked there. keystore_only=2 adds that unlock to the initrd phase: - /dev/sep-bio-rearm is published as soon as the key store is open. Until complete_attach it serves only what a password unlock needs: state, import, unlock, lock and FDE unseal. Create, change, export and the FDE create/seal requests return EAGAIN; enrolment stays on the real root. - Loading and unlocking a bag needs enclave writes to the gigalocker, so xART follows xart_writes in this mode, but only while the xART guard is off: the guard's record list lives in host files on the real root, which the initrd must not write. With a guard, xART stays read-only, the bag requests fail with EROFS and the volume falls back to its passphrase. - Nothing changes for keystore_only=0 or 1. complete_attach is unchanged and publishes the rest of the node's requests. load-driver completes the attach for either initrd mode. KUnit: the initrd request subset and the initrd xART write rule. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Assisted-by: LLM
|
Hardware rows, J700 (Neo), real Secure Enclave, kernel 7.3.0-aurora-seproot2 (the #1471 branch merged onto 8b7c2af), userspace a8f9562. The tests ran on LUKS2 image files only. SELinux was enforcing, with 0 AVCs on each boot. Boot 1 (images with 256 KiB metadata): 43 of 44 rows pass.
Boot 2 (after a real reboot, no bags in the enclave): 10 of 10 rows pass.
Metadata size: the first run used the default 16 KiB LUKS2 metadata area. The third user and the recovery key failed with ENOSPC, because a real wrapped bag is 1520 B and a hex token about 4 KB. Fixed in a8f9562 (base64 fields, and a clear error). Even with base64, a 16 KiB area takes 3 password tokens plus the recovery offline slot. Encrypted-root entry (dracut initramfs with keystore_only=2, the token plugin and Plymouth) is installed non-default with the os_uuid pin. The rows at the Plymouth prompt need a person typing and have not run yet. |
Stacked on #1339.
keystore_only=1: the initrd attaches the SEP key store for trusted keys only. Touch ID and the host-state store wait until the real root writescomplete_attach.keystore_only=2: as 1, and/dev/sep-bio-rearmalso serves the password unlock of a per-user key bag in the initrd: state, import, unlock, lock and FDE unseal.complete_attach.xart_writesin this mode only while the xART guard is off. With a guard, the bag requests fail with EROFS, and the volume falls back to its passphrase or recovery key.Tests:
drivers/soc/apple/sep.kunitconfig: covers the initrd request subset and the initrd xART write rule. On this branch merged onto 8b7c2af: 469 tests, 467 pass, 0 fail, 2 skipped (not SEP tests; all 22 apple_sep suites pass).modinfo -F parm apple-sep.kolistskeystore_onlywith both modes.🤖 Generated with Claude Code