From f88c801e012967b9ad936730d6b22ed4b35c9be5 Mon Sep 17 00:00:00 2001 From: bunnie Date: Thu, 13 Nov 2025 11:06:16 +0800 Subject: [PATCH] update key ACL to r/w this allows the OS to initialize the keys note that including write access only gives it to the fw0 user, which is the OS's secure user. thus any write primitive created by this expansion of access should transitively also be a read primitive (which is actually what the adversary desires). In exchange the OS is allowed to initialize the keys, which I think is the right place to do it given that it's too hard at this point to nail down the exact key layout, etc. Note that it is impossible for the OS to change ACLs - that is a feature that can only be updated by the boot user - which is why the boot user can change the ACL to gain access to erase keys, but the OS user can't modify its own ACL. --- libs/bao1x-api/src/offsets/baosec.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libs/bao1x-api/src/offsets/baosec.rs b/libs/bao1x-api/src/offsets/baosec.rs index aa238e022..e0a00327e 100644 --- a/libs/bao1x-api/src/offsets/baosec.rs +++ b/libs/bao1x-api/src/offsets/baosec.rs @@ -44,13 +44,13 @@ pub const DEFAULT_FCLK_FREQUENCY: u32 = 700_000_000; /// are derived from. The seed may be blended with other bits of data scattered about /// the RRAM array, other device identifiers and hardware measurements to create the final /// device secret key. -pub const ROOT_SEED: SlotIndex = SlotIndex::Key(256, PartitionAccess::Fw0, RwPerms::ReadOnly); +pub const ROOT_SEED: SlotIndex = SlotIndex::Key(256, PartitionAccess::Fw0, RwPerms::ReadWrite); /// The `RMA_KEY` is a secret parameter that is unique per-device secret which is recorded /// at manufacturing time. Its purpose is to facilitate the creation of a signed RMA /// authorization certificate which upon receipt would blank the device and unlock various /// features for debugging failed hardware. -pub const RMA_KEY: SlotIndex = SlotIndex::Key(257, PartitionAccess::Fw0, RwPerms::ReadOnly); +pub const RMA_KEY: SlotIndex = SlotIndex::Key(257, PartitionAccess::Fw0, RwPerms::ReadWrite); /// Reserved for use as a CP to FT tracking cookie. This is used to help track inventory /// between CP and FT, if such a feature is desired in the supply chain. Blanked on entry @@ -58,7 +58,7 @@ pub const RMA_KEY: SlotIndex = SlotIndex::Key(257, PartitionAccess::Fw0, RwPerms pub const CP_COOKIE: SlotIndex = SlotIndex::Key(258, PartitionAccess::Fw0, RwPerms::ReadWrite); /// The swap encryption key. Used to protect swap images beyond the signing key, if we so desire. -pub const SWAP_KEY: SlotIndex = SlotIndex::Key(259, PartitionAccess::Fw0, RwPerms::ReadOnly); +pub const SWAP_KEY: SlotIndex = SlotIndex::Key(259, PartitionAccess::Fw0, RwPerms::ReadWrite); /// `NUISANCE_KEYS` are hashed together with `ROOT_SEED` to derive the core secret. /// Their primary purpose is to annoy microscopists trying to read the secret key by @@ -85,9 +85,9 @@ pub const SWAP_KEY: SlotIndex = SlotIndex::Key(259, PartitionAccess::Fw0, RwPerm /// numbered data slots. Some of the data slots in the first 8 slots will be read-only at CP time, and /// thus they can't be initialized with random data and be used as a nuisance key. This is a minor degradation /// in security margin. -pub const NUISANCE_KEYS_0: SlotIndex = SlotIndex::KeyRange(8..128, PartitionAccess::Fw0, RwPerms::ReadOnly); +pub const NUISANCE_KEYS_0: SlotIndex = SlotIndex::KeyRange(8..128, PartitionAccess::Fw0, RwPerms::ReadWrite); pub const NUISANCE_KEYS_1: SlotIndex = - SlotIndex::KeyRange(1920..2048, PartitionAccess::Fw0, RwPerms::ReadOnly); + SlotIndex::KeyRange(1920..2048, PartitionAccess::Fw0, RwPerms::ReadWrite); pub const NUISANCE_KEYS: [SlotIndex; 2] = [NUISANCE_KEYS_0, NUISANCE_KEYS_1]; /// `CHAFF_KEYS` are a bank of keys that are hashed into the key array, but instead of