[BUG] Reserved heap consumes alignment gaps and can return misaligned payloads #34
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#34
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 Kernel heap hid a header and alignment prefix inside every allocation. A fresh 4 KiB page allocation consumed 8 KiB, and higher alignments were calculated from a reservation-relative offset rather than the actual address. The correction removes allocation headers, preserves both free split pieces, aligns actual addresses and derives release geometry from the exact original Layout.
Reproduction
At signed Kernel
fb05646d4aa4ad2ba97882cf5e90c296a58122b2, the maintained managed-frame-occupancy VM passed its allocator subchecks but failed later during service startup. It reported a 4,096-byte allocation aligned to 4,096 bytes, 43,560 free bytes and a largest free extent of 6,752 bytes. QEMU exited 41 instead of 33, and the wrapper exited 1. The serial scalars do not identify the exact requesting source site.A mechanically extracted host control retained the original allocator operation bodies while disabling global registration. Three original controls failed: page-allocation storage cost, reuse of alignment-prefix storage, and actual alignment above the reservation's alignment. A fourth control passed ordinary payload preservation and complete release. This is host evidence of the alignment defect; no original native high-alignment exploit was executed. Original failures were retained without unchanged retries.
Expected and actual behavior
Requests must align the actual returned pointer, retain reusable free prefixes/suffixes and preserve every live payload. Allocator metadata now occupies only free backing. A unique core operates under the existing global lock; exact original Layout custody is required for release, and adjacent free extents coalesce. The correction retains the image-owned reservation, failure injection, diagnostics and capability boundaries. It acquires no additional RAM or userspace grant.
Environment and identity
Linux x86_64 host, Rust 1.97.1, signed 73-component catalog selected through Integration
29ad3b16ddb25972097c9d277158bab0115da013, TCG, one CPU, OVMF, original 80 MiB Kernel heap and 60-second occupancy deadline. Original BOOT.IMG SHA-256:9da89ff426062385495fff3ba488ba53c8fbc197ca803b1d5b10ba4541ebd7fa. Seven principal artifacts and 77 producer/cache files retain the failed image; all 73 source signatures and its exact normally stripped Kernel ELF verify.Evidence and prior checks
Seven corrected host controls cover packing, actual alignment, overflow/exhaustion without mutation, independent live payloads, all release orders and a bounded 1,024-step storage trace. A fresh page request consumes 4,096 bytes instead of 8,192. With the same 64 KiB arena, 32 slots and request policy, refusals fall from 20 to 15. Original peak requested/consumed bytes are 58,678/65,520; corrected peaks are 62,124/62,336. These are separately measured maxima; accepted operations can diverge after refusal. They establish neither latency improvement nor a native speedup.
Four strict configurations pass 830/854 tests with three existing ignored cases. Sixteen native build/Clippy profiles, formatting and host/native private rustdoc pass without warnings. The catalog passes all 172 maintained helpers. Both native allocator scenarios pass actual global-allocation checks at page, 64 KiB and 1 MiB alignment, independent payload reuse, and all prior service-readiness gates under the original memory and 60/120-second deadlines. Lifetime, invocation, both mapping contracts and ordinary exec-successor across 73 components also pass. Exact source signatures and packaged artifacts verify without image warnings or QEMU stderr.
Integration regression acceptance remains open. Complete semantic authority review and external-toolchain/EriX guest rebuilding remain open.
Tracking
Related owned address-space design, Kernel review, Integration review and Phase 6 completion.
Further original ext4 CI evidence — 23 September 2026: Integration 1741 and 1742, at
3c92de7ff68b332adc5d5de41e0e06af7ed4c1fe, complete the 489-scenario catalog with 478/11 and 481/8 pass/fail outcomes. All nineteen failures are ext4 scenarios reaching their original 120-second QEMU deadline, tracked under the existing ext4 deadline report. Rust 320/321-test configurations and Markdown pass. Both corrected managed-frame-occupancy and allocator-domain scenarios pass. The later canonical development/release image and physical-input gates are not reached.Six complete original Integration logs total 34,342,962 bytes and have verified lengths/hashes with zero warning candidates. With the earlier successful Kernel 660/661 and Docs 1025/1026 logs, fourteen complete logs total 35,963,864 bytes and have zero final warnings. All nineteen timeout transcripts lack VFS_IO readiness and contain no scenario-forbidden fault markers. Eighteen end their complete EriX markers at LOGD_REPLY_WAKE_OK; one metadata transcript ends its complete markers at LOGD_REPLY_WRITE_OK followed by a partial next marker. Printed markers do not identify the executing instruction at the deadline or establish a Logd defect, filesystem cause or host-load explanation.
These are original executions on a later source graph, without retries, wider deadlines or changed success oracles. The ext4 report remains open. Complete corrected CI acceptance for Kernel #33 and Kernel #34 also remains open; passing selected allocator cases does not stand in for unreached workflow gates. This terminal run pair is fully retained and classified. Newer private mapping population checks and their CI remain separate, and full external-toolchain/runtime and EriX guest rebuilding are still required.
Complete owned-traversal CI review — 23 September 2026: original Integration 1743 and 1744, at
4fce71efe6277332b7dcad110c9c87eb57040e58selecting Kernelb90a80c94721f99d2a829117dd29123b3aaebc7c, both pass all 489 catalog VM scenarios. Native lifetime, managed-frame occupancy, allocator-domain, canonical development/release images, physical input and remaining workflow gates pass. Rust 320/321-test configurations, profiler validation and Markdown also pass. Six complete Integration logs total 26,973,962 bytes with zero warning candidates; with eight previously reviewed Kernel/Docs logs, fourteen complete logs total 28,603,130 bytes with zero final warnings.This graph retains the exact corrected reserved-heap and temporary-CSpace cleanup code, and its Kernel descends from their signed correction. Complete corrected CI now closes Kernel #33 and Kernel #34. Their original native/host failures and later nineteen ext4 CI deadlines remain retained. No failing job was rerun and no limit or success oracle changed. Both new full runs pass the ext4 scenarios; the original timeout cause is still unproven, so Integration #73 remains open for attribution and timing review.
Later leaf/population/ancestor cohorts retain their own CI acceptance. Complete semantic authority review, root activation, external Rust/LLVM/runtime rebuilding and both complete EriX guest-build generations remain required. Canonical acceptance stays 15/460 leaves, weighted 3.48%.
erikinkinen referenced this issue2026-09-23 09:43:49 +02:00
erikinkinen referenced this issue2026-09-23 09:43:50 +02:00
erikinkinen referenced this issue from erix/integration2026-09-23 09:43:55 +02:00
erikinkinen referenced this issue from erix/docs2026-09-23 09:43:59 +02:00