[BUG] Checked VSpace range rounding can panic on an unrepresentable end #37
Labels
No labels
alpha-1
bug
ci
docs
duplicate
enhancement
help wanted
invalid
performance
phase-6
question
refactor
security
wontfix
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
erix/kernel#37
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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 baseu64::MAX - 4095and length1, 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.
erikinkinen referenced this issue2026-09-23 16:45:45 +02:00
erikinkinen referenced this issue from erix/integration2026-09-23 16:45:51 +02:00