Skip to content

soc: apple: sep: policy window test: admit the initrd ref-key unseal - #1561

Merged
DjDeveloperr merged 1 commit into
aurora-silicon:integration/aurorafrom
satchlj:satchlj/policy-window-initrd-test
Nov 11, 2026
Merged

DjDeveloperr merged 1 commit into
aurora-silicon:integration/aurorafrom
satchlj:satchlj/policy-window-initrd-test

Conversation

@satchlj

@satchlj satchlj commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

Claude Fable 5.2 on @satchlj's behalf

Fixes the source check, 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_window was written on a branch without 519d09b ("support a trusted-key-only initrd attach"). That commit makes refkey_unseal_cached build its unlock as a closure and run it inside policy_window on 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 under keystore_only, and inside crate::xart_guard::policy_window otherwise. 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.py and with -O: 4/4 pass on integration/aurora 17efdf6 (1 failure before).
  • Two deliberate regressions in a scratch copy of refkey.rs each still fail the test: running unlock() bare on the real-root branch, and removing policy_window from the other ref-key unlock.

Not run: the rest of the source workflow locally, any kernel build, any hardware (nothing compiled changes).

🤖 Generated with Claude Code

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>
@satchlj

satchlj commented Nov 11, 2026

Copy link
Copy Markdown
Member Author

Claude Fable 5.2 on @satchlj's behalf

The host-tests failure on 0363e18 is the runner bootstrap, not this change: "Pin the host toolchains" could not resolve azure.archive.ubuntu.com (apt exit 100), the same mirror failure @DjDeveloperr patched on #973 and #1490. No test ran. I have re-run the failed job once; source, kunit and rust-build are still queued. This PR only changes tools/aurora-sep/tests/test_policy_window.py, which source runs.

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@DjDeveloperr
DjDeveloperr merged commit ea10c4d into aurora-silicon:integration/aurora Nov 11, 2026
4 of 5 checks passed
DjDeveloperr added a commit to sithglan/aurora-linux that referenced this pull request Nov 11, 2026
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>
DjDeveloperr added a commit that referenced this pull request Nov 11, 2026
Use the exact upstream test from ea10c4d; supersede the duplicate local repair. Production source is unchanged.

Signed-off-by: Diljit Singh <hey@djdev.me>
DjDeveloperr added a commit to joske/linux that referenced this pull request Nov 11, 2026
Use the exact upstream test from ea10c4d; supersede the duplicate local repair. Production source is unchanged.

Signed-off-by: Diljit Singh <hey@djdev.me>
DjDeveloperr added a commit to 7robertodantas/linux that referenced this pull request Nov 11, 2026
Use the exact upstream test from ea10c4d; supersede the duplicate local repair. Production source is unchanged.

Signed-off-by: Diljit Singh <hey@djdev.me>
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