[BUG] New mappings save another active VSpace leaf for later restoration #39

Closed
opened 2026-09-24 00:51:16 +02:00 by erikinkinen · 0 comments
Owner

Summary

Resolved in the validated POSIX compatibility feature branch: creating an ordinary frame or anonymous mapping could save a different active VSpace's leaf as the new mapping's restoration value. New mapping records now select effective supervisor policy from the retained baseline, preserving existing capability checks, backing rollback and boot-source reconciliation. This report was held privately until the correction passed native validation.

Reproduction

The affected published Kernel runtime is 8844a473170a8e6c62443808ff30286715affdbd, also retained unchanged beneath documentation checkpoint 49fbe8aba8f44bd0fe074de8a7aedc07668710a4. A privately signed isolated native probe preserved production mapping and transition operations byte for byte. It created two VSpaces with distinct owned pages at one initially absent address, activated the first, and mapped the second while inactive. It observed the second mapping's saved restoration value, then withdrew the fixture alias and retired both objects before asserting the observation.

The probe ran once and failed the saved-restoration assertion. All original source identities and failed artifacts were retained. The maintained corrected probes run via:

bash scripts/run-native-kernel-vm.sh lifetime
bash scripts/run-scenario.sh tests/scenarios/kernel-managed-frame-occupancy-positive.toml components.toml
bash scripts/run-scenario.sh tests/scenarios/subsystem-ram-allocator-domain-positive.toml components.toml

Expected and actual behavior

Expected: the second record saves the absent supervisor baseline, regardless of the first VSpace's active user mapping. Later withdrawal restores supervisor policy before releasing backing.

Actual on the original isolated probe: runner status 1, panic at the first saved-restoration assertion after alias withdrawal and exact fixture object/table census recovery. The saved value differs from the absent supervisor baseline. The following restored-leaf assertion was not reached. This demonstrates an incorrect saved restoration source; it does not demonstrate a CPL3 exploit or access to freed memory.

Environment and identity

  • Affected development-branch Kernel identities are above; complete affected-history range and last known good revision are not established.
  • Original isolated lifetime image, native x86-64 QEMU/OVMF, Rust 1.97.1, existing lifetime diagnostic profile and original timeout.
  • The diagnostic retained both VSpaces and their distinct backing through observation; no private CR3 was installed and no userspace executed inside this fixture.
  • Original packaged Kernel SHA-256: a20a0e82634772a6a70d1b12c04e53d8508a9f72792221bede367c4a87915a48. It matches the normally stripped signed diagnostic build.
  • Correction: Kernel 90ec13f16d22219ec9194b95cd61316b24aa4bb6; coherent Integration selection.

Evidence and prior checks

The original failure retains seven principal image/runtime files, 347 producer files and verification of all fifteen source signatures. Its cleanup completed before the failed assertion. The correction selects the retained supervisor baseline in both mapping creation paths and shares that selector with private withdrawal. Selection allocates no shared table and grants no mapping or backing rights.

Four strict Kernel matrices pass 899/923 tests with three existing ignored cases, sixteen native build/Clippy profiles and host/native private rustdoc. All 172 Integration helpers pass. Six corrected native executions satisfy seven maintained contracts, including anonymous and managed peer-mapping checks through deactivation, active unmap and final active-VSpace destruction. Peer bytes remain intact; original observation failures propagate after mandatory cleanup. Managed probes borrow the occupancy fixture's existing MAP grant. Every earlier witness, capability grant and deadline remains required.

All fifteen native and 73 service source signatures and original packaged artifacts verify. Corrected images emit no build warnings and QEMU stderr is empty. The manual passes 45 tests and complete 2,441-page generation, with changed pages and all word bounds reviewed without final warnings. Broader CI monitoring remains separate; this correction makes no performance or private-root residency claim.

Tracking

The correction is committed and pushed on feature/posix-compat; it is not merged or released. Kernel PR 3, Integration PR 12, manual PR 4 and owned address-space design retain the broader work. Phase 6 completion remains open, including actual-root routing, hardware activation, external toolchain rebuilding and two full EriX guest-build generations.

## Summary Resolved in the validated POSIX compatibility feature branch: creating an ordinary frame or anonymous mapping could save a different active VSpace's leaf as the new mapping's restoration value. New mapping records now select effective supervisor policy from the retained baseline, preserving existing capability checks, backing rollback and boot-source reconciliation. This report was held privately until the correction passed native validation. ## Reproduction The affected published Kernel runtime is `8844a473170a8e6c62443808ff30286715affdbd`, also retained unchanged beneath documentation checkpoint `49fbe8aba8f44bd0fe074de8a7aedc07668710a4`. A privately signed isolated native probe preserved production mapping and transition operations byte for byte. It created two VSpaces with distinct owned pages at one initially absent address, activated the first, and mapped the second while inactive. It observed the second mapping's saved restoration value, then withdrew the fixture alias and retired both objects before asserting the observation. The probe ran once and failed the saved-restoration assertion. All original source identities and failed artifacts were retained. The maintained corrected probes run via: ```sh bash scripts/run-native-kernel-vm.sh lifetime bash scripts/run-scenario.sh tests/scenarios/kernel-managed-frame-occupancy-positive.toml components.toml bash scripts/run-scenario.sh tests/scenarios/subsystem-ram-allocator-domain-positive.toml components.toml ``` ## Expected and actual behavior Expected: the second record saves the absent supervisor baseline, regardless of the first VSpace's active user mapping. Later withdrawal restores supervisor policy before releasing backing. Actual on the original isolated probe: runner status 1, panic at the first saved-restoration assertion after alias withdrawal and exact fixture object/table census recovery. The saved value differs from the absent supervisor baseline. The following restored-leaf assertion was not reached. This demonstrates an incorrect saved restoration source; it does not demonstrate a CPL3 exploit or access to freed memory. ## Environment and identity - Affected development-branch Kernel identities are above; complete affected-history range and last known good revision are not established. - Original isolated lifetime image, native x86-64 QEMU/OVMF, Rust 1.97.1, existing lifetime diagnostic profile and original timeout. - The diagnostic retained both VSpaces and their distinct backing through observation; no private CR3 was installed and no userspace executed inside this fixture. - Original packaged Kernel SHA-256: `a20a0e82634772a6a70d1b12c04e53d8508a9f72792221bede367c4a87915a48`. It matches the normally stripped signed diagnostic build. - Correction: [Kernel `90ec13f16d22219ec9194b95cd61316b24aa4bb6`](https://git.erikinkinen.fi/erix/kernel/commit/90ec13f16d22219ec9194b95cd61316b24aa4bb6); coherent [Integration selection](https://git.erikinkinen.fi/erix/integration/commit/894fd619dac2eb65e0d16ee472fd326675949359). ## Evidence and prior checks The original failure retains seven principal image/runtime files, 347 producer files and verification of all fifteen source signatures. Its cleanup completed before the failed assertion. The correction selects the retained supervisor baseline in both mapping creation paths and shares that selector with private withdrawal. Selection allocates no shared table and grants no mapping or backing rights. Four strict Kernel matrices pass 899/923 tests with three existing ignored cases, sixteen native build/Clippy profiles and host/native private rustdoc. All 172 Integration helpers pass. Six corrected native executions satisfy seven maintained contracts, including anonymous and managed peer-mapping checks through deactivation, active unmap and final active-VSpace destruction. Peer bytes remain intact; original observation failures propagate after mandatory cleanup. Managed probes borrow the occupancy fixture's existing MAP grant. Every earlier witness, capability grant and deadline remains required. All fifteen native and 73 service source signatures and original packaged artifacts verify. Corrected images emit no build warnings and QEMU stderr is empty. The manual passes 45 tests and complete 2,441-page generation, with changed pages and all word bounds reviewed without final warnings. Broader CI monitoring remains separate; this correction makes no performance or private-root residency claim. ## Tracking The correction is committed and pushed on `feature/posix-compat`; it is not merged or released. [Kernel PR 3](https://git.erikinkinen.fi/erix/kernel/pulls/3), [Integration PR 12](https://git.erikinkinen.fi/erix/integration/pulls/12), [manual PR 4](https://git.erikinkinen.fi/erix/docs/pulls/4) and [owned address-space design](https://git.erikinkinen.fi/erix/kernel/issues/22) retain the broader work. [Phase 6 completion](https://git.erikinkinen.fi/erix/integration/issues/65) remains open, including actual-root routing, hardware activation, external toolchain rebuilding and two full EriX guest-build generations.
erikinkinen 2026-09-24 00:51:16 +02:00
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#39
No description provided.