Repository navigation
Pre-key locks on 64 KiB pages: per-target block alignment; open 0.9.0-rc.14 - #266
Merged
Merged
Conversation
…s; open 0.9.0-rc.14 The block was aligned to 16 KiB everywhere and a larger page was refused. It now takes its alignment from a per-target table after the secrets crate (1.3.0, src/secret.rs): 16 KiB on x86, x86_64 and Apple aarch64, 64 KiB on other aarch64 and any unlisted target, with the pre-key's 16 KiB as the floor. The block owns every page it touches, so the lock and the unlock reach nothing else. The page-size refusal stays as the fallback. Cross-compiled for six targets with each alignment asserted at compile time; not run on 64 KiB-page hardware. Suggested by the sealed-memory review. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Jd6eJgv7urGn4rvMcVASo2
Slurp9187
added a commit
that referenced
this pull request
Oct 19, 2026
- LockError::page_too_large says the bound is the block's alignment, not the pre-key. - Prekey::new documents that an unoptimized build stages the block on the stack. - Drop a const assertion that cannot fail (size is always a multiple of alignment). - The lock-success unit test skips a host whose page exceeds the block's alignment instead of clamping the size and locking a page it shares. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Jd6eJgv7urGn4rvMcVASo2
13 of 16 tasks
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.
Follow-up to #265 (sealed memory, shipped in 0.9.0-rc.13), from the review of that release.
The pre-key block was aligned to 16 KiB everywhere, and on a page larger than that the lock was refused (
Prekey::lock_status()reported it). It now takes its alignment from a per-target table after thesecretscrate (1.3.0,src/secret.rs; added there after its own unlock-a-neighbour bug, #109), with the pre-key's 16 KiB as the floor:The block owns every page it touches, so locking it locks nothing else and unlocking it on drop cannot release a neighbour's lock. On 64 KiB-aligned targets a
Prekeytakes 64 KiB, all locked; only the first 16 KiB hold the pre-key. The page-size refusal stays as the fallback for any target the table gets wrong. Compile-time assertions pin that the block holds the pre-key and fills whole aligned units; the tests now use the block's alignment instead of a hard-coded 16 KiB.Also opens 0.9.0-rc.14 (manifest, lockfile, README pins, CHANGELOG
Unreleasedsection) and updates SECURITY.md §3, thesealedmodule docs and the design note.Checked
-D warnings, stable 1.98.1; trybuild on 1.85; rustdoc stable, nightlydocsrsand--features=full; thumbv7em; residue-probe).sealedfor x86_64 Windows / Linux / macOS, aarch64 Linux / macOS and ppc64le Linux, each with a scratch compile-time assertion of that target's promised alignment and block size; flipping aarch64 Linux's expectation fails the build.Not checked
🤖 Generated with Claude Code
https://claude.ai/code/session_01Jd6eJgv7urGn4rvMcVASo2