[BUG] Physical range refusal can leave an untracked published prefix #36

Open
opened 2026-09-23 14:29:03 +02:00 by erikinkinen · 0 comments
Owner

Summary

The original physical-range installer published one page before preparing the next. A later page failure could therefore leave earlier user leaves while the caller had not yet published its range row or installed-backing flag. The correction prepares every affected PT before any requested leaf publication, under one table lock and masked-interrupt scope.

Reproduction

Three controlled host tests use the exact original map_physical_range_pages loop from signed Kernel 2a4cbd2ef4d42aca62876da55fce33476912c620. An explicit fixture-owned page-effect adapter refuses the second page at 0x40000000, a PT/PD boundary after first page 0x3ffff000. Both WriteBack and WriteCombining tests fail their no-partial-publication assertion, retaining one successful page effect; the first-page-refusal control passes. The earlier abstract third-page refusal, which retained two effects without placing that refusal at a new table boundary, is also preserved separately. Original Rust test status is 101, with one pass and two failures. Source inspection places the caller's new range-row publication after complete loop success. All original sources, hashes and streams are retained without an unchanged failing-input retry.

This is execution of the unchanged production loop with a controlled fallible-effect adapter. It does not establish an original native allocation-failure reproduction, practical userspace exploit, or cause of the separate ext4 CI deadlines.

Expected and actual behavior

Refusing a new range before inventory publication must not leave unaccounted user leaves. Complete preparation now reserves one compact descriptor per affected PT and retains its scoped entry key. Structural failure can leave equivalent table splits and ancestor-ceiling propagation, but publishes no requested backing or access. Once every span is ready, all requested stores complete without allocation, fallible traversal or callbacks. Structural errors and successful publication synchronize translations before exclusion ends; overwritten GLOBAL entries receive explicit invalidation.

Scalar, batch and range paths share one explicit physical-entry encoder, preserving read/write/execute and cache policy. No fixed range-count limit, capability, backing grant or activatable private root is added. Caller admission and post-success inventory publication remain unchanged. This correction does not establish atomicity across a whole multi-range VSpace activation.

Environment and identity

Original Kernel 2a4cbd2ef4d42aca62876da55fce33476912c620, Integration 7aa451477c8ac5238bb6c334b69a466b2a94996b, Linux x86_64 host and Rust 1.97.1 with strict warnings. Original host effects use exclusive scalar fixture storage and touch no physical memory. Corrected native mapping validation uses original one-CPU TCG/OVMF settings, the 60-second deadline and unchanged grants. Last known working revision and original native exploit reachability are not established.

Evidence and prior checks

Six new host controls cover all preparation-failure boundaries, no early leaf writes, exact cross-PT spans, outside leaves, cache/write policy, geometry rejection and GLOBAL invalidation. Four strict host configurations pass 860/884 tests with three existing ignored cases. Sixteen native build/Clippy profiles, formatting and host/native private rustdoc pass without warnings. An initial strict-Clippy complaint in a new test assertion is retained and corrected with explicit parentheses; no lint is suppressed. All 172 Integration helpers pass, while unchanged Rust and profiler sources retain their strict validation.

Six exact-source native executions satisfy seven maintained contracts, including both allocator scenarios and ordinary exec-successor across 73 original components. The new PHYSICAL_RANGE_PUBLICATION_OK witness retains exclusive RAM, verifies actual physical contiguity, exercises three identity aliases across a PT boundary, checks real bytes and write/NX policy, and restores every original alias before releasing backing. The RAM probe retains WriteBack cache policy; WriteCombining encoding is covered by host controls. Exact signed sources and retained packaged artifacts verify without image warnings or QEMU stderr. Every previous witness, grant and deadline remains required.

Integration regression acceptance remains open. Private registered/physical range population, whole-VSpace activation and external toolchain/EriX guest rebuilding remain open.

Tracking

Related owned address-space design, Kernel review, Integration review, corrected catalog and Phase 6 completion.

## Summary The original physical-range installer published one page before preparing the next. A later page failure could therefore leave earlier user leaves while the caller had not yet published its range row or installed-backing flag. The [correction](https://git.erikinkinen.fi/erix/kernel/commit/b94e0e7afa99b200e511f5bcf752e57d43409109) prepares every affected PT before any requested leaf publication, under one table lock and masked-interrupt scope. ## Reproduction Three controlled host tests use the exact original map_physical_range_pages loop from signed Kernel `2a4cbd2ef4d42aca62876da55fce33476912c620`. An explicit fixture-owned page-effect adapter refuses the second page at `0x40000000`, a PT/PD boundary after first page `0x3ffff000`. Both WriteBack and WriteCombining tests fail their no-partial-publication assertion, retaining one successful page effect; the first-page-refusal control passes. The earlier abstract third-page refusal, which retained two effects without placing that refusal at a new table boundary, is also preserved separately. Original Rust test status is 101, with one pass and two failures. Source inspection places the caller's new range-row publication after complete loop success. All original sources, hashes and streams are retained without an unchanged failing-input retry. This is execution of the unchanged production loop with a controlled fallible-effect adapter. It does not establish an original native allocation-failure reproduction, practical userspace exploit, or cause of the separate ext4 CI deadlines. ## Expected and actual behavior Refusing a new range before inventory publication must not leave unaccounted user leaves. Complete preparation now reserves one compact descriptor per affected PT and retains its scoped entry key. Structural failure can leave equivalent table splits and ancestor-ceiling propagation, but publishes no requested backing or access. Once every span is ready, all requested stores complete without allocation, fallible traversal or callbacks. Structural errors and successful publication synchronize translations before exclusion ends; overwritten GLOBAL entries receive explicit invalidation. Scalar, batch and range paths share one explicit physical-entry encoder, preserving read/write/execute and cache policy. No fixed range-count limit, capability, backing grant or activatable private root is added. Caller admission and post-success inventory publication remain unchanged. This correction does not establish atomicity across a whole multi-range VSpace activation. ## Environment and identity Original Kernel `2a4cbd2ef4d42aca62876da55fce33476912c620`, Integration `7aa451477c8ac5238bb6c334b69a466b2a94996b`, Linux x86_64 host and Rust 1.97.1 with strict warnings. Original host effects use exclusive scalar fixture storage and touch no physical memory. Corrected native mapping validation uses original one-CPU TCG/OVMF settings, the 60-second deadline and unchanged grants. Last known working revision and original native exploit reachability are not established. ## Evidence and prior checks Six new host controls cover all preparation-failure boundaries, no early leaf writes, exact cross-PT spans, outside leaves, cache/write policy, geometry rejection and GLOBAL invalidation. Four strict host configurations pass 860/884 tests with three existing ignored cases. Sixteen native build/Clippy profiles, formatting and host/native private rustdoc pass without warnings. An initial strict-Clippy complaint in a new test assertion is retained and corrected with explicit parentheses; no lint is suppressed. All 172 Integration helpers pass, while unchanged Rust and profiler sources retain their strict validation. Six exact-source native executions satisfy seven maintained contracts, including both allocator scenarios and ordinary exec-successor across 73 original components. The new PHYSICAL_RANGE_PUBLICATION_OK witness retains exclusive RAM, verifies actual physical contiguity, exercises three identity aliases across a PT boundary, checks real bytes and write/NX policy, and restores every original alias before releasing backing. The RAM probe retains WriteBack cache policy; WriteCombining encoding is covered by host controls. Exact signed sources and retained packaged artifacts verify without image warnings or QEMU stderr. Every previous witness, grant and deadline remains required. Integration regression acceptance remains open. Private registered/physical range population, whole-VSpace activation and external toolchain/EriX guest rebuilding remain open. ## Tracking Related [owned address-space design](https://git.erikinkinen.fi/erix/kernel/issues/22), [Kernel review](https://git.erikinkinen.fi/erix/kernel/pulls/3), [Integration review](https://git.erikinkinen.fi/erix/integration/pulls/12), [corrected catalog](https://git.erikinkinen.fi/erix/integration/commit/7d41f641863380ee9550e85a42009fa47b34a3cd) and [Phase 6 completion](https://git.erikinkinen.fi/erix/integration/issues/65).
erikinkinen added this to the Alpha 1 milestone 2026-10-30 09:34:28 +01:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
erix/kernel#36
No description provided.