[BUG] Retained table inspection exposes mutable hardware-visible word references #42
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#42
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
Owned table storage exposed an ordinary mutable array even after publication into hardware page tables. Retained-table inspection obtained that reference merely to derive the allocation address. This is a source-level storage-boundary finding: no original runtime failure, observed undefined-behavior outcome or exploit is asserted. The corrected representation is published after strict and native validation.
Reproduction
At Kernel 650cd1d62ae2847cf5a6d092bd276048a8f8b25c, trace
TableStorage::entriesthroughHeapTableandtable_page::verify_retained_tables. The latter obtains the array after table publication to derive its virtual address before guarded translation. The huge-page witness likewise observes published words through ordinary references and volatile reads. Exact original source identities are retained; this review does not deliberately create conflicting references or demonstrate a runtime failure.Expected and actual behavior
Table cleanup ownership must remain unique while hardware-visible words accommodate the processor's accessed/dirty updates. Software locking alone does not exclude those updates, and volatile access does not relax ordinary reference rules inside a Rust allocation. The original interface returned
&mut [u64; 512]from one aligned owned page.The correction removes that interface and retains scalar reads, explicit writes and descriptive allocation geometry over aligned atomic words. Acquire loads and release stores preserve entry access without returning ordinary word references. Copying, rollback, huge splitting and all native consumers use the same contract. Exactly one allocation owner remains; geometry grants no mapping, activation or cleanup authority. Existing table, interrupt, backing, root-identity and invalidation requirements remain mandatory. No resource ceiling or unsafe Send/Sync implementation is added.
Environment and identity
Original Kernel
650cd1d62ae2847cf5a6d092bd276048a8f8b25c; corrected executable Kernelb63921064e299e28525f0077511fbaee165b814e, Integrationf2154e6f550330a400cb31ed2ac75a982e2cc572, unchanged Bootloaderec00005c324ae05dc6f2faf57c496185d297726b. Rust 1.97.1 and native x86-64 four-level paging under QEMU/OVMF. Private roots are still never activated; readiness, residency and remote invalidation remain separate work.Evidence and prior checks
The contract follows official Rust interior-mutability rules, atomic word representation and Intel SDM 253668-092US section 11.1.2.1 on locked hardware accessed/dirty updates. Only longstanding load/store APIs are used; this does not claim a general language-model proof for arbitrary device memory.
Four strict Kernel configurations pass 915/939 tests with three existing ignored cases, including actual concurrent hardware-style observation and effective ancestor-policy controls. Eighteen native build/binary Clippy profiles, formatting and host/native/long-mode private rustdoc pass without warnings. Exact-module optimized x86-64 accessors use aligned MOV without locked exchange or fences; this is a code-generation check, not a timing benchmark.
Ten exact-source native executions satisfy eleven maintained contracts, including actual accessed bits in every one of the 512 split leaves, complete restoration before owner disposal, lifetime/invocation, both allocators, ordinary exec-successor and four SMP profiles. All original grants, markers and deadlines remain required. Source signatures and normally stripped packaged artifacts verify without image warnings or QEMU stderr. Integration helpers and both Rust crates retain identical fully validated inputs. The complete manual passes 45 tests and 2,445 pages, with all 455,574 word bounds and changed pages reviewed without final warnings or overflow.
Tracking
Validated changes: Kernel, Integration and manual. Owning Kernel PR 3, Integration PR 12, owned address spaces and Phase 6 completion retain the broader obligations. Keep this report open for publication CI review. No private-root activation, complete authority closure, performance improvement or full guest build is claimed.
erikinkinen referenced this issue2026-09-24 15:31:35 +02:00
erikinkinen referenced this issue2026-09-24 15:31:38 +02:00
erikinkinen referenced this issue from erix/integration2026-09-24 15:31:50 +02:00
erikinkinen referenced this issue from erix/docs2026-09-24 15:32:01 +02:00