Repository navigation
soc: apple: sep: policy window test: admit the initrd ref-key unseal - #1561
Conversation
test_no_other_path_designates_outside_a_window fails on integration/aurora since aurora-silicon#1340 merged, which fails the source check of every pull request. The test was written on a branch without 519d09b ("support a trusted-key-only initrd attach"). That commit builds the ref-key unlock as a closure in refkey_unseal_cached and runs it inside crate::xart_guard::policy_window on the real root, but bare in the trusted-key-only initrd (keystore_only), on purpose: "Do not consume the real root's one policy window in the initrd". With the window shut the guard lets no existing session record be rewritten, so that path cannot make the rewrite the test protects against. Accept exactly that shape: the one deferred call in refkey_unseal_cached, whose closure is used twice, bare under keystore_only and in the window otherwise. Any other caller still has to open or close the window before the call. No runtime change. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Satya Benson <satya@benson.earth>
|
Claude Fable 5.2 on @satchlj's behalf The |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Reviewed: test-only, with no runtime change, in a single file (tools/aurora-sep/tests/test_policy_window.py). The allowance is narrow. Only (refkey.rs, refkey_unseal_cached) may defer, only inside a let unlock = || { closure, and exactly once. The closure must be used exactly twice, as if self.keystore_only.load(Relaxed) { unlock() } else { crate::xart_guard::policy_window(unlock) }, which matches 519d09b's code on integration/aurora. Every other PREPARE caller still has to open or close the window before the call. re is already imported. I'll merge once all its checks are green on this head.
ea10c4d
into
aurora-silicon:integration/aurora
integration/aurora now has the agreed fix for the policy-window test, aurora-silicon#1561 (ea10c4d). The earlier merge into this branch had carried a different version of the same test change, and combining the two leaves aurora-silicon#1561's deferred-call count at zero, which fails the source check. Take integration/aurora's test file as it is: this pull request is J813 audio and changes nothing under tools/aurora-sep. Signed-off-by: Diljit Singh <hey@djdev.me>
Use the exact upstream test from ea10c4d; supersede the duplicate local repair. Production source is unchanged. Signed-off-by: Diljit Singh <hey@djdev.me>
Use the exact upstream test from ea10c4d; supersede the duplicate local repair. Production source is unchanged. Signed-off-by: Diljit Singh <hey@djdev.me>
Use the exact upstream test from ea10c4d; supersede the duplicate local repair. Production source is unchanged. Signed-off-by: Diljit Singh <hey@djdev.me>
Claude Fable 5.2 on @satchlj's behalf
Fixes the
sourcecheck, which fails on every linux PR since #1340 merged (reported by @DjDeveloperr in #1340 (comment)).Cause. #1340's static test
test_no_other_path_designates_outside_a_windowwas written on a branch without 519d09b ("support a trusted-key-only initrd attach"). That commit makesrefkey_unseal_cachedbuild its unlock as a closure and run it insidepolicy_windowon the real root, but bare in the trusted-key-only initrd (keystore_only), with the comment "Do not consume the real root's one policy window in the initrd".Change (test only, no runtime change). This is option 1 from DJ's question: the initrd path is treated as the documented exception. The test now accepts exactly one deferred call, in
refkey_unseal_cached, and only when its closure is used twice: bare underkeystore_only, and insidecrate::xart_guard::policy_windowotherwise. Every other caller must still open or close the window before the call.Why option 1 is consistent with #1340. #1340 protects against an existing session record being rewritten outside the window. With the window shut, the guard does not let that rewrite through, so the initrd path cannot cause it; under a changed boot policy it fails instead. Whether the initrd should open a window is @RyanTheTide's call (519d09b is his design); if he wants option 2, this test is the place to tighten afterwards.
Checked
python3 -m unittest tools/aurora-sep/tests/test_policy_window.pyand with-O: 4/4 pass on integration/aurora 17efdf6 (1 failure before).refkey.rseach still fail the test: runningunlock()bare on the real-root branch, and removingpolicy_windowfrom the other ref-key unlock.Not run: the rest of the
sourceworkflow locally, any kernel build, any hardware (nothing compiled changes).🤖 Generated with Claude Code