[BUG] Ordinary mappings can replace the supervisor local-controller alias #40

Open
opened 2026-09-24 14:41:18 +02:00 by erikinkinen · 0 comments
Owner

Summary

The former low LAPIC alias overlapped the ordinary user mapping domain. A Kernel controller consumer interpreted the physical APIC base as a virtual pointer, so an otherwise admitted mapping could replace the backing used by that consumer. The coordinated correction is natively validated and published.

Reproduction

An original host control admits and cleans up a managed-frame mapping at the former alias. A separate single-CPU native diagnostic observes the supervisor leaf, activates owned RAM there, restores the exact original leaf and disposes all temporary CSpace, VSpace and table owners before its intentional failure. It keeps interrupts masked and does not access MMIO through the replaced alias. The original failed execution is retained without retry.

Expected and actual behavior

Expected: ordinary mapping authority must not replace an address used by a privileged controller consumer. Observed: the original supervisor leaf changes from controller backing to owned RAM and restores exactly. This confirms leaf replacement, not an original CPL3 exploit or actual device access. The correction prepares one permanent supervisor Kernel-image alias before APs and baseline capture, validates enabled xAPIC mode, physical identity and strong-UC PAT policy, and gives each fixed-register view short CPU-local interrupt/table custody. The view is neither Send nor Sync. Bootloader removes its low IOAPIC/LAPIC aliases and masks interrupts before final CR3. Former low addresses remain available for ordinary RAM; no arbitrary user-domain exclusion is introduced.

Environment and identity

Original producer/consumer graph: Kernel ba0ed5b2cc and Bootloader acc1e734f79366e965b7ab7cd41496afddc6b1fe. Corrected executable graph: Kernel 6908d2ec82, Bootloader ec00005c324ae05dc6f2faf57c496185d297726b, Integration dcaa6df2e5ad30b7cf6313c880c6c8d51b47096f. Native x86-64 QEMU/OVMF; original 60/120-second scenario limits.

Evidence and prior checks

The strengthened lifetime contract denies the exact high controller alias from real CPL3, maps ordinary RAM at the former low address, reads the actual controller ID and verifies shared/private supervisor leaves through protection, unmap and grant disposal. Every earlier capability grant, witness and cleanup condition remains required. The corrected graph passes four SMP profiles plus seven maintained mapping, lifetime, invocation, allocator and ordinary exec-successor contracts across ten actual native executions. Mapping/isolation and sparse use their identical runtime capture with both original marker contracts. All original limits remain required. Source signatures and original normally stripped packaged Kernels verify; image warnings and QEMU stderr are absent. Four strict Kernel configurations pass 914/938 tests with three existing ignored cases, and eighteen native build/binary Clippy profiles and private rustdoc pass without warnings. Bootloader passes all four host/UEFI configurations with 34 unit and seven standalone tests, signing controls and four Python fixture suites. Integration retains all 172 helper and 100 Rust crate/fixture inputs from their complete validation. The complete manual passes 45 tests and 2,445 pages without final warnings or overflow.

Tracking

The validated coordinated changes are published in Kernel, Bootloader, Integration and the manual. Owning Kernel PR 3, Bootloader PR 3, Integration PR 12, owned address-space work and Phase 6 completion retain the broader acceptance work. Publication CI at 2026-09-24T12:49:44.573423+00:00: bootloader: 144 success, 143 success; kernel: 697 success, 696 success; docs: 1058 success, 1057 success; integration: 1778 waiting, 1777 waiting. Complete successful bootloader/kernel/docs logs retained and reviewed: 12 logs, 1,848,864 bytes, zero final warnings. Initial TeX reference warnings precede clean final passes. Original failed inputs have not been rerun; the open startup-silence report is unaffected. Full Integration regression review remains pending; keep this report open until that evidence is complete. No merge, release, performance improvement or full guest-build acceptance is claimed.

## Summary The former low LAPIC alias overlapped the ordinary user mapping domain. A Kernel controller consumer interpreted the physical APIC base as a virtual pointer, so an otherwise admitted mapping could replace the backing used by that consumer. The coordinated correction is natively validated and published. ## Reproduction An original host control admits and cleans up a managed-frame mapping at the former alias. A separate single-CPU native diagnostic observes the supervisor leaf, activates owned RAM there, restores the exact original leaf and disposes all temporary CSpace, VSpace and table owners before its intentional failure. It keeps interrupts masked and does not access MMIO through the replaced alias. The original failed execution is retained without retry. ## Expected and actual behavior Expected: ordinary mapping authority must not replace an address used by a privileged controller consumer. Observed: the original supervisor leaf changes from controller backing to owned RAM and restores exactly. This confirms leaf replacement, not an original CPL3 exploit or actual device access. The correction prepares one permanent supervisor Kernel-image alias before APs and baseline capture, validates enabled xAPIC mode, physical identity and strong-UC PAT policy, and gives each fixed-register view short CPU-local interrupt/table custody. The view is neither Send nor Sync. Bootloader removes its low IOAPIC/LAPIC aliases and masks interrupts before final CR3. Former low addresses remain available for ordinary RAM; no arbitrary user-domain exclusion is introduced. ## Environment and identity Original producer/consumer graph: Kernel ba0ed5b2ccdf3e1bdf543fd7443b6fd08f137d7b and Bootloader acc1e734f79366e965b7ab7cd41496afddc6b1fe. Corrected executable graph: Kernel 6908d2ec82c2e646a74a5253a21fb27fbd517c9c, Bootloader ec00005c324ae05dc6f2faf57c496185d297726b, Integration dcaa6df2e5ad30b7cf6313c880c6c8d51b47096f. Native x86-64 QEMU/OVMF; original 60/120-second scenario limits. ## Evidence and prior checks The strengthened lifetime contract denies the exact high controller alias from real CPL3, maps ordinary RAM at the former low address, reads the actual controller ID and verifies shared/private supervisor leaves through protection, unmap and grant disposal. Every earlier capability grant, witness and cleanup condition remains required. The corrected graph passes four SMP profiles plus seven maintained mapping, lifetime, invocation, allocator and ordinary exec-successor contracts across ten actual native executions. Mapping/isolation and sparse use their identical runtime capture with both original marker contracts. All original limits remain required. Source signatures and original normally stripped packaged Kernels verify; image warnings and QEMU stderr are absent. Four strict Kernel configurations pass 914/938 tests with three existing ignored cases, and eighteen native build/binary Clippy profiles and private rustdoc pass without warnings. Bootloader passes all four host/UEFI configurations with 34 unit and seven standalone tests, signing controls and four Python fixture suites. Integration retains all 172 helper and 100 Rust crate/fixture inputs from their complete validation. The complete manual passes 45 tests and 2,445 pages without final warnings or overflow. ## Tracking The validated coordinated changes are published in [Kernel](https://git.erikinkinen.fi/erix/kernel/commit/650cd1d62ae2847cf5a6d092bd276048a8f8b25c), [Bootloader](https://git.erikinkinen.fi/erix/bootloader/commit/ed8ba424bf49ad09c154ca9116d653b63973ca51), [Integration](https://git.erikinkinen.fi/erix/integration/commit/4149f332dce6567f8f2db0f503154d8980a52e48) and [the manual](https://git.erikinkinen.fi/erix/docs/commit/8af70ddcf42cb60dbf5ed0952184f2bbac14fe77). Owning [Kernel PR 3](https://git.erikinkinen.fi/erix/kernel/pulls/3), [Bootloader PR 3](https://git.erikinkinen.fi/erix/bootloader/pulls/3), [Integration PR 12](https://git.erikinkinen.fi/erix/integration/pulls/12), [owned address-space work](https://git.erikinkinen.fi/erix/kernel/issues/22) and [Phase 6 completion](https://git.erikinkinen.fi/erix/integration/issues/65) retain the broader acceptance work. Publication CI at 2026-09-24T12:49:44.573423+00:00: bootloader: [144](https://git.erikinkinen.fi/erix/bootloader/actions/runs/144) success, [143](https://git.erikinkinen.fi/erix/bootloader/actions/runs/143) success; kernel: [697](https://git.erikinkinen.fi/erix/kernel/actions/runs/697) success, [696](https://git.erikinkinen.fi/erix/kernel/actions/runs/696) success; docs: [1058](https://git.erikinkinen.fi/erix/docs/actions/runs/1058) success, [1057](https://git.erikinkinen.fi/erix/docs/actions/runs/1057) success; integration: [1778](https://git.erikinkinen.fi/erix/integration/actions/runs/1778) waiting, [1777](https://git.erikinkinen.fi/erix/integration/actions/runs/1777) waiting. Complete successful bootloader/kernel/docs logs retained and reviewed: 12 logs, 1,848,864 bytes, zero final warnings. Initial TeX reference warnings precede clean final passes. Original failed inputs have not been rerun; the open startup-silence report is unaffected. Full Integration regression review remains pending; keep this report open until that evidence is complete. No merge, release, performance improvement or full guest-build acceptance is claimed.
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#40
No description provided.