[BUG] Frame mappings add unrequested user read access #26
Labels
No labels
bug
ci
docs
duplicate
enhancement
help wanted
invalid
performance
phase-6
question
refactor
security
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
erix/kernel#26
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
The original ordinary mapping path admitted write-only and execute-only access and emitted user-accessible leaves for records with no requested user access. The fixed Kernel carries explicit READ through admission, activation and leaf encoding. No-access mappings retain backing with USER/WRITE clear and NX set; unsupported combinations fail without adding READ.
Reproduction
Four owned-fixture host controls ran once against original Kernel
841583c562. Changes were limited to tests, their module declaration and a test-only view of the unchanged production encoder. The command wascargo test --locked --no-default-features frame_access_ -- --nocapture, with strict warning flags. Three controls failed and one passed. The introducing revision and last known working revision are unknown.Expected and actual behavior
Four write-only/execute-only attempts returned Ok(()) instead of RootSlotPolicyViolation, including restricted frame ceilings and readable grants whose requests omitted READ. No-access mappings requested as zero or MAP emitted USER bit 4 instead of zero. Removing final READ produced the same mismatch on activation. Supported R/RW/RX literal-bit checks passed.
The correction rejects WRITE or EXECUTE without requested READ and retains the W+X prohibition. Current rights determine both immediate mappings and later activation. No-access mappings remain present with USER/WRITE clear and NX set. Seven added host controls cover the original boundaries, preserved protection refusals, reactivation and managed allocation reclamation only after final unmap. Unreachable ordinary anonymous/fallback branches are removed. Existing protection-transition rules remain unchanged; general POSIX protection semantics are not established.
Environment and identity
Evidence and prior checks
Four strict configurations pass 757 default / 781 all-feature tests, with three pre-existing ignored cases. Formatting, strict host/native Clippy, host/native private rustdoc and thirteen native builds pass without warnings. The original failing host evidence remains retained; the original unsafe behavior was not executed natively.
The corrected lifetime fixture executes 24 CPL3 calls and preserves every earlier domain and VSpace MAP witness. Further calls remove access, reject write-only access, derive a MAP-only frame alias after dropping the previous occupant, reject READ through that alias and unmap after both frame grants are dropped. Native leaf checks require exact backing, USER/WRITE clear and NX set in every inaccessible state, and exact original restoration after unmap. All original and derived grants are disposed. Execute-only admission is covered by managed-frame host controls; the native DeviceFrame fixture does not establish that case.
All 172 Integration helpers pass; unchanged orchestration and profiler Rust sources retain their strict matrices. Three exact-source native executions pass lifetime, invocation and mapping, with isolation and sparse contracts checked on the identical-runtime mapping capture. All fifteen selected signatures verify; each packaged Kernel equals one retained original artifact after normal stripping. The ordinary exec-successor service VM passes against the full 73-component graph and its original 120-second guest limit. Image builds emit no warnings and QEMU stderr is empty.
The manual change passes 45 tests and 2,433 pages; 450,702 word bounds and the changed rendered page are reviewed, with zero final warnings or overflow.
Tracking
Fixed in Kernel PR 3, coordinated through Integration PR 12 and Docs PR 4. VSpace MAP admission is separately recorded in report 25; independent hardware roots remain in Kernel issue 22. Full authority cleanup, measured performance improvement, external toolchain rebuilding and both complete EriX guest-build generations remain open in the phase checklist.
Publication CI: Kernel 640/641 and Docs 1011/1012 pass. Each pair has four complete logs: Kernel totals 782,838 bytes with zero warnings, and Docs totals 775,110 bytes with zero final warnings or overflow. The manual retains its initial 35/1/0 LaTeX warning sequence through convergence. Integration 1723/1724 remains queued; it receives no CI acceptance credit.