Repository navigation
Conversation
SEP_BIO_FDE_CREATE, FDE_SEAL and FDE_UNSEAL designated the key store user as the raw uid. Every other user-bag ioctl designates USER_BAG_BASE + uid (bag_designation), which is the bag SEP_BIO_KEYBAG_UNLOCK opens with the user's password. The FDE work landed in parallel with the offset and was never moved over. The result: uid 1000 sealed its disk secret under designated user 1000, which is the Linux identity bag (trusted keys, the machine ref-key, Touch ID's catacomb user), not under the bag its password unlocks. Other uids pointed at a bag that KEYBAG_UNLOCK never opens, so the uAPI promise "opens it only while the bag of 'uid' is unlocked" did not hold. Use bag_designation() in parse_fde() and FDE_CREATE. It also brings the MAX_UID bound, so the separate i32::MAX check goes. Records made before this change sit under the wrong bag and must be created again; the FDE ioctls are a design draft, not a stable ABI. The ref-key doc comment now names the real outer handle. Verified: a host rustc --test copy of the designation math shows the old code gave uid 1000 the identity bag's handle and the new code gives the same handle as KEYBAG_UNLOCK for MIN_UID..MAX_UID, refusing MAX_UID + 1. A new KUnit case, fde_uses_the_user_bag, asserts the handle is -(USER_BAG_BASE + uid). The kernel Rust code was not compiled here. Not run on hardware. Creating an FDE record and unsealing it again on a Mac, before and after this change, is needed before this is merged. Signed-off-by: Alyx-ML <256263590+Alyx-ML@users.noreply.github.com>
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.
Part of the #2755 split. Draft: it needs a hardware create and unseal row.
Summary
FDE records made before this change sit under the wrong bag and must be made again. The FDE
ioctls are a design draft, not a stable ABI.
Evidence
rustc --testcopy of the designation math gives uid 1000 the identity bag'shandle.
KEYBAG_UNLOCK's handle for MIN_UID..MAX_UID and refuses MAX_UID + 1. KUnitfde_uses_the_user_bagin SEP source checks: passed, Apple build and KUnit, SEP source checks.Merge Danger
Door: one-way
Blast Radius: existing FDE records
Records made with the old designation are orphaned.
Assisted-by: LLM (Claude:Opus 5.5)