[BUG] Checked VSpace range rounding can panic on an unrepresentable end #37

Open
opened 2026-09-23 16:45:34 +02:00 by erikinkinen · 0 comments
Owner

Summary

VSpace range normalization checked base-plus-length but rounded the resulting exclusive end with unchecked addition. With overflow checking enabled, a last-page input panicked instead of returning the established setup error. The correction reuses the existing checked architecture normalizer and removes both redundant local alignment helpers.

Reproduction

Four controlled host tests execute byte-for-byte extracted production range-normalization and alignment function bodies from signed Kernel b730e0ac7e8433949315223c92e1f1b811b5bd44. For base u64::MAX - 4095 and length 1, the VSpace helper panics under explicit overflow checks. The architecture helper correctly rejects the same input. Ordinary unaligned ranges and explicit base-plus-length overflow are passing controls. Original checked output has three passes, one failure and status 101. A separately compiled optimized configuration with overflow checks explicitly disabled has four passes: later geometry checks reject the wrapped end. Both original configurations, source hashes and output streams are retained without an unchanged failing-input retry.

This is controlled execution of unchanged scalar helper bodies with a local test Result/error definition. No original native panic, untrusted caller reachability or memory/authority exploit is established.

Expected and actual behavior

An unrepresentable rounded exclusive end must return RootLaunchSetupFailed before inventory or table mutation in either arithmetic configuration. Checked normalization now serves both VSpace recording and hardware range edits. Initialization, object lookup and root retained-source denial ordering remain intact. Numeric geometry conveys no backing or mapping authority.

Registered Kernel-owned range, boot-image import, withdrawal and sealed source-retirement functions also move into their own module with the same function bodies and public paths. The parent VSpace file is 606 lines and the new module is 316 lines.

Environment and identity

Linux x86_64, Rust 1.97.1, original signed Kernel b730e0ac7e8433949315223c92e1f1b811b5bd44. The original fixture explicitly selects overflow-checking on and off; it is not evidence of a specific original guest build's execution. Corrected native checks use the maintained one-CPU lifetime scenario, original grants and 60-second limit.

Evidence and prior checks

Two added host tests cover wider-arithmetic boundary expectations and actual registration/import/physical/removal/retirement refusal without inventory mutation. Four strict Kernel configurations pass 868/892 tests with three existing ignored cases. Sixteen native build/Clippy profiles, formatting and host/native private rustdoc pass without warnings. Initial strict compilation caught an obsolete local align-down helper after deduplication; that original output is preserved and the unused helper is removed without suppression.

All 172 Integration helpers pass. Both unchanged Integration crates retain their freshly validated strict matrices: orchestration 320/321 tests and profiler five tests in both profiles. Six exact-source native executions pass seven maintained contracts, including both allocator scenarios and ordinary exec-successor across 73 components. RANGE_GEOMETRY_DENIAL_OK requires actual registered/image/physical APIs to reject the boundary input before inventory or table changes, followed by full existing cleanup. Original signed sources and packaged artifacts verify without image warnings or QEMU stderr. Every prior marker, grant and deadline remains required.

Integration regression acceptance remains open. Registered private image/stack population, root activation and full external toolchain/EriX guest rebuilding remain open.

Tracking

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

## Summary VSpace range normalization checked base-plus-length but rounded the resulting exclusive end with unchecked addition. With overflow checking enabled, a last-page input panicked instead of returning the established setup error. The [correction](https://git.erikinkinen.fi/erix/kernel/commit/695ef5778691d32db03515bb407f8986e5f95b63) reuses the existing checked architecture normalizer and removes both redundant local alignment helpers. ## Reproduction Four controlled host tests execute byte-for-byte extracted production range-normalization and alignment function bodies from signed Kernel `b730e0ac7e8433949315223c92e1f1b811b5bd44`. For base `u64::MAX - 4095` and length `1`, the VSpace helper panics under explicit overflow checks. The architecture helper correctly rejects the same input. Ordinary unaligned ranges and explicit base-plus-length overflow are passing controls. Original checked output has three passes, one failure and status 101. A separately compiled optimized configuration with overflow checks explicitly disabled has four passes: later geometry checks reject the wrapped end. Both original configurations, source hashes and output streams are retained without an unchanged failing-input retry. This is controlled execution of unchanged scalar helper bodies with a local test Result/error definition. No original native panic, untrusted caller reachability or memory/authority exploit is established. ## Expected and actual behavior An unrepresentable rounded exclusive end must return RootLaunchSetupFailed before inventory or table mutation in either arithmetic configuration. Checked normalization now serves both VSpace recording and hardware range edits. Initialization, object lookup and root retained-source denial ordering remain intact. Numeric geometry conveys no backing or mapping authority. Registered Kernel-owned range, boot-image import, withdrawal and sealed source-retirement functions also move into their own module with the same function bodies and public paths. The parent VSpace file is 606 lines and the new module is 316 lines. ## Environment and identity Linux x86_64, Rust 1.97.1, original signed Kernel `b730e0ac7e8433949315223c92e1f1b811b5bd44`. The original fixture explicitly selects overflow-checking on and off; it is not evidence of a specific original guest build's execution. Corrected native checks use the maintained one-CPU lifetime scenario, original grants and 60-second limit. ## Evidence and prior checks Two added host tests cover wider-arithmetic boundary expectations and actual registration/import/physical/removal/retirement refusal without inventory mutation. Four strict Kernel configurations pass 868/892 tests with three existing ignored cases. Sixteen native build/Clippy profiles, formatting and host/native private rustdoc pass without warnings. Initial strict compilation caught an obsolete local align-down helper after deduplication; that original output is preserved and the unused helper is removed without suppression. All 172 Integration helpers pass. Both unchanged Integration crates retain their freshly validated strict matrices: orchestration 320/321 tests and profiler five tests in both profiles. Six exact-source native executions pass seven maintained contracts, including both allocator scenarios and ordinary exec-successor across 73 components. RANGE_GEOMETRY_DENIAL_OK requires actual registered/image/physical APIs to reject the boundary input before inventory or table changes, followed by full existing cleanup. Original signed sources and packaged artifacts verify without image warnings or QEMU stderr. Every prior marker, grant and deadline remains required. Integration regression acceptance remains open. Registered private image/stack population, root activation and full 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/82e5db37715fe62a56fde5f30b2499cbf3ae73f6) 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:29 +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#37
No description provided.