[FEATURE] Audit authority, code quality and documentation in bootloader #2

Open
opened 2026-09-12 07:57:25 +02:00 by erikinkinen · 0 comments
Owner

Problem and motivation

Audit bootloader throughout Phase 6. Verify boot-critical payloads and construct the initial kernel handoff at the firmware trust boundary.

Review each changed boundary at the final published revision. Prioritize security, reliability, then performance.

Proposed behavior and scope

Current inventory: 1 Cargo target (1 bin); manifests: Cargo.toml. Include explicit and automatically discovered targets, supported features and target-specific configurations.

Inventory every startup/runtime grant and authenticated peer, then success, denial, cancellation, failed transfer, restart and teardown. Trace callers and downstream providers so names, numeric identities and retained aliases never become implicit authority.

Authority, security and reliability

Record each finding's affected revision, invariant, reproduction, owner, regression coverage and resolution. Report suspected vulnerabilities through SECURITY.md and keep sensitive details private. Record a result and rationale for each audit criterion, including caller responsibilities when this component has no process or Rust target.

Acceptance criteria

Checklist
  • Record origin, recipient, object, operations, delegation ceiling, lifetime and aliases for each relevant capability or caller-supplied authority-bearing value.
  • Audit ambient discovery/selectors, cwd/PATH/environment, numeric identities, inherited routes and host fallbacks; require explicit authorized intake.
  • Account for residual authority after success, error, cancellation, timeout, restart, failed transfer and teardown, including fork/exec where implemented.
  • Remove unnecessary endpoints, broad rights, duplicate aliases, provider/admin grants and debug routes.
  • Exercise stale generations, replay, pending replies, forged descriptive identity and object/path resolution races at the owned boundary.
  • Prove independent cleanup attempts and caller-specific error precedence; quarantine or terminate when retained authority cannot be accounted for.
  • Review unsafe/FFI/parser/arithmetic/lifetime/lock/publication invariants and add adversarial coverage where practical.
  • Inventory obsolete APIs, wrappers, fallback/dead paths and duplicate validators with their maintained callers.
  • Migrate callers and delete deprecated contracts/shims in a coherent signed revision graph; reject retired input versions where relevant.
  • Classify each size/count/depth/time bound as ABI, hardware, explicit resource policy or accidental limitation.
  • Test beyond removed boundaries and at allocation/ABI limits while preserving exhaustion errors, denial-of-service controls and bounded waits.
  • Keep every tracked authored code/test/script/workflow file below 1000 physical lines through thematic refactoring.
  • Run the deterministic tracked-source size gate, covering executable fixtures/generators and excluding only genuine non-code data or external payloads.
  • Audit production/test feature and symbol separation, including this repository's effect on rootd test orchestration.
  • Supply changes affecting rootd semantic surface to the maintained same-toolchain baseline; record a justified component-specific applicability result.
  • Check bootstrap ownership and development/release authority parity at this repository's producer/consumer boundary.
  • Use maintained integration#3 profiler evidence before optimizing; preserve live access checks, ownership and success criteria.
  • Audit build/CI inputs, secret handling, private outputs, symlink containment, deletion, subprocess bounds, warnings and host dependencies.
  • meaningful public/private inline documentation, crate/target missing_docs enforcement without blanket allowances or hidden-API escapes, warning-denied private-item rustdoc and an undocumented-public-API negative gate.
  • Validation: Run cargo fmt --all -- --check, strict Clippy, unit/doctests and warning-denied builds/rustdoc for every owned crate/target under default and all valid feature, freestanding/host, SMP and profile combinations; test mutually exclusive combinations separately. Add focused VM regressions for runtime behavior and observe the older catalog and unit tests at the exact published heads.
  • Documentation: update applicable README/ARCHITECTURE/ROADMAP in meta's canonical format and affected technical-manual TeX/API references; keep README evergreen and shared governance byte-identical to meta.
  • Evidence: record exact source/dependency revisions, commands, configurations, real exit status, CI run URLs and results; repeat the audit on final heads and obtain independent review of security closures. No skipped/pending/predecessor result counts as a pass.

Alternatives and tradeoffs

Refactor within the component unless shared semantics justify extracting common code. Preserve regression coverage before deleting superseded paths. Profile before optimizing, and document ABI limits, hardware limits and explicit quotas. Preserve security and reliability requirements.

Tracking and rollout

The correction is signed as e7fa39357a38c21529cccfd16cf3446eb07e8aa5. The actual namespace predicate now follows the defining crate in legacy and Rust v0 names, preserving the four exact C memory names and the core/alloc/compiler-builtins boundary. Foreign definitions cannot gain access by mentioning a permitted type later in the name. Prefix recognition uses checked lengths and iterative traversal; the unchanged loader still requires an exact authenticated kernel export.

The original predicate fails against an observed v0 import. Five new classifier regressions pass, including observed names, namespace refusal, malformed prefixes and 4,096 nested path components. All strict development/release default/all-feature host and UEFI checks pass locally: 34 unit and seven standalone tests per selection, plus the 12/22/13/6 Python suites. Formatting, private/build-script rustdoc and canonical documents pass with no compiler or lint warnings.

Push CI 135 and PR CI 136 pass for that signed head. Four complete logs total 144,258 bytes without warning candidates. Both workflows complete the original source preparation, fresh profile comparisons and deliberate release diagnostic checks; raw CI EFI/PDB artifacts are not published for independent byte inspection.

A new signed-image VM using this Bootloader resolves imports, seals mappings and enters Kernel under the unchanged 60-second hard and 45-second silence limits. The loader defect is resolved. The overall lifetime scenario still fails its required serial markers; Kernel issue 9 tracks that separate diagnostic defect. No realm rollout or full guest build is established.

  • Parent work: erix/integration#2 and erix/docs#1.
  • Branch: feature/posix-compat; update linked WIP PRs after coherent signed checkpoints using canonical CONTRIBUTING.md messages.
  • Baseline revision: 55f2e5295adcff8215269ff694aabb85a276f122; refresh component/dependency heads and their own CI evidence as implementation advances.
  • Cross-repository dependencies remain full lowercase commit hashes; update the selected graph deliberately. This issue does not authorize merges, release tags or replacement of published images.

Verified supervisor controller isolation and real AP scheduler observation — 24 September 2026: Kernel and Bootloader remove the ordinary-domain controller alias conflict recorded in the controller report. The original diagnostic confirms supervisor leaf replacement by owned RAM and exact restoration before complete temporary-owner cleanup; it does not claim an original CPL3 exploit or actual device access. The correction prepares one permanent supervisor Kernel-image alias before AP startup and baseline capture. Fixed-register views retain CPU-local interrupt custody and validate mode, physical identity, cache policy and the exact active leaf. They are neither Send nor Sync. Bootloader removes its low controller aliases and excludes interrupts before final CR3. Ordinary low-address RAM remains usable.

The added four-CPU long-mode scenario exposed premature scheduler observation. An observation-only diagnostic records 32 BSP switches, all tasks seen, three attached APs and zero AP switches. The corrected witness observes independent AP progress within a retained processor-clock deadline, with immediate errors and incomplete expiry preserved. State guards end before waiting. Simulated/trampoline workloads and original outer VM limits remain unchanged. Scheduler runtime, VM witnesses and host tests are separated into documented modules; three new controls cover delayed real scheduler counters, expiry and errors.

Four strict Kernel configurations pass 914/938 tests with three existing ignored cases. Eighteen native build/binary Clippy profiles, formatting and host/native/long-mode private rustdoc pass without warnings. Bootloader passes all four host/UEFI configurations with 34 unit and seven standalone tests each, signing controls and four Python fixture suites. Integration selects the exact executable graph in all three catalogs; catalog/source checks pass and all 172 helper implementations and 100 Rust crate/fixture inputs retain their complete strict validation. The manual passes 45 tests and all 2,445 pages; all 455,408 word bounds and changed page 2,424 are reviewed without final warnings or overflow. Static audit covers 3,259 authored code files below 1,000 lines, 75 manifests, 259 exact Git pins, 174 direct missing_docs gates and 93 conventional crate roots. Accepted document structures and canonical governance bytes remain intact.

Ten exact-source native executions satisfy eleven maintained contracts: lifetime, mapping/isolation and sparse, owned invocation, both allocators, ordinary exec-successor and four SMP profiles. Both mapping contracts share one identical runtime capture with their separate maintained oracles. Actual CPL3 denies the high controller alias; controller reads and shared/private leaves remain correct through ordinary low-address RAM mapping, protection and disposal. Long-mode startup observes all three APs online with real attachment, switches and join. Every previous marker, grant, cleanup assertion and original 60/120-second deadline remains required. All fifteen native and 73 service signatures and original packaged artifacts verify without image warnings or QEMU stderr. Ordinary exec retains 106 artifact files and 56,616 serial bytes; its 48.284099-second complete build/run is not a speedup claim.

The original pre-entry startup-silence failure remains open. Its read-only QMP diagnostic and later changed-source bringup pass do not explain or repair it. No unchanged failed input was retried for acceptance. The three new reports use bug_report with applicable bug, security, ci, refactor and phase-6 labels; the two corrected defects remain open for publication CI review. 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.

Owning Kernel review, Bootloader review, Integration review, manual review and Phase 6 completion remain unfinished. Owned address-space routing and residency, semantic authority and inline-documentation closure, and older CI regressions including release physical-directory input remain open. Canonical acceptance remains 15/460 leaves, weighted 3.48%; external Rust/LLVM/runtime rebuilding inside EriX and both complete EriX guest-build generations remain mandatory and unproven.

## Problem and motivation Audit `bootloader` throughout Phase 6. Verify boot-critical payloads and construct the initial kernel handoff at the firmware trust boundary. Review each changed boundary at the final published revision. Prioritize security, reliability, then performance. ## Proposed behavior and scope Current inventory: 1 Cargo target (1 bin); manifests: `Cargo.toml`. Include explicit and automatically discovered targets, supported features and target-specific configurations. Inventory every startup/runtime grant and authenticated peer, then success, denial, cancellation, failed transfer, restart and teardown. Trace callers and downstream providers so names, numeric identities and retained aliases never become implicit authority. ## Authority, security and reliability Record each finding's affected revision, invariant, reproduction, owner, regression coverage and resolution. Report suspected vulnerabilities through SECURITY.md and keep sensitive details private. Record a result and rationale for each audit criterion, including caller responsibilities when this component has no process or Rust target. ## Acceptance criteria <details> <summary>Checklist</summary> - [ ] Record origin, recipient, object, operations, delegation ceiling, lifetime and aliases for each relevant capability or caller-supplied authority-bearing value. - [ ] Audit ambient discovery/selectors, cwd/PATH/environment, numeric identities, inherited routes and host fallbacks; require explicit authorized intake. - [ ] Account for residual authority after success, error, cancellation, timeout, restart, failed transfer and teardown, including fork/exec where implemented. - [ ] Remove unnecessary endpoints, broad rights, duplicate aliases, provider/admin grants and debug routes. - [ ] Exercise stale generations, replay, pending replies, forged descriptive identity and object/path resolution races at the owned boundary. - [ ] Prove independent cleanup attempts and caller-specific error precedence; quarantine or terminate when retained authority cannot be accounted for. - [ ] Review unsafe/FFI/parser/arithmetic/lifetime/lock/publication invariants and add adversarial coverage where practical. - [ ] Inventory obsolete APIs, wrappers, fallback/dead paths and duplicate validators with their maintained callers. - [ ] Migrate callers and delete deprecated contracts/shims in a coherent signed revision graph; reject retired input versions where relevant. - [ ] Classify each size/count/depth/time bound as ABI, hardware, explicit resource policy or accidental limitation. - [ ] Test beyond removed boundaries and at allocation/ABI limits while preserving exhaustion errors, denial-of-service controls and bounded waits. - [ ] Keep every tracked authored code/test/script/workflow file below 1000 physical lines through thematic refactoring. - [ ] Run the deterministic tracked-source size gate, covering executable fixtures/generators and excluding only genuine non-code data or external payloads. - [ ] Audit production/test feature and symbol separation, including this repository's effect on rootd test orchestration. - [ ] Supply changes affecting rootd semantic surface to the maintained same-toolchain baseline; record a justified component-specific applicability result. - [ ] Check bootstrap ownership and development/release authority parity at this repository's producer/consumer boundary. - [ ] Use maintained [integration#3](https://git.erikinkinen.fi/erix/integration/issues/3) profiler evidence before optimizing; preserve live access checks, ownership and success criteria. - [ ] Audit build/CI inputs, secret handling, private outputs, symlink containment, deletion, subprocess bounds, warnings and host dependencies. - [ ] meaningful public/private inline documentation, crate/target `missing_docs` enforcement without blanket allowances or hidden-API escapes, warning-denied private-item rustdoc and an undocumented-public-API negative gate. - [ ] Validation: Run `cargo fmt --all -- --check`, strict Clippy, unit/doctests and warning-denied builds/rustdoc for every owned crate/target under default and all valid feature, freestanding/host, SMP and profile combinations; test mutually exclusive combinations separately. Add focused VM regressions for runtime behavior and observe the older catalog and unit tests at the exact published heads. - [ ] Documentation: update applicable README/ARCHITECTURE/ROADMAP in meta's canonical format and affected technical-manual TeX/API references; keep README evergreen and shared governance byte-identical to meta. - [ ] Evidence: record exact source/dependency revisions, commands, configurations, real exit status, CI run URLs and results; repeat the audit on final heads and obtain independent review of security closures. No skipped/pending/predecessor result counts as a pass. </details> ## Alternatives and tradeoffs Refactor within the component unless shared semantics justify extracting common code. Preserve regression coverage before deleting superseded paths. Profile before optimizing, and document ABI limits, hardware limits and explicit quotas. Preserve security and reliability requirements. ## Tracking and rollout The correction is signed as `e7fa39357a38c21529cccfd16cf3446eb07e8aa5`. The actual namespace predicate now follows the defining crate in legacy and Rust v0 names, preserving the four exact C memory names and the core/alloc/compiler-builtins boundary. Foreign definitions cannot gain access by mentioning a permitted type later in the name. Prefix recognition uses checked lengths and iterative traversal; the unchanged loader still requires an exact authenticated kernel export. The original predicate fails against an observed v0 import. Five new classifier regressions pass, including observed names, namespace refusal, malformed prefixes and 4,096 nested path components. All strict development/release default/all-feature host and UEFI checks pass locally: 34 unit and seven standalone tests per selection, plus the 12/22/13/6 Python suites. Formatting, private/build-script rustdoc and canonical documents pass with no compiler or lint warnings. [Push CI 135](https://git.erikinkinen.fi/erix/bootloader/actions/runs/135) and [PR CI 136](https://git.erikinkinen.fi/erix/bootloader/actions/runs/136) pass for that signed head. Four complete logs total 144,258 bytes without warning candidates. Both workflows complete the original source preparation, fresh profile comparisons and deliberate release diagnostic checks; raw CI EFI/PDB artifacts are not published for independent byte inspection. A new signed-image VM using this Bootloader resolves imports, seals mappings and enters Kernel under the unchanged 60-second hard and 45-second silence limits. The loader defect is resolved. The overall lifetime scenario still fails its required serial markers; [Kernel issue 9](https://git.erikinkinen.fi/erix/kernel/issues/9) tracks that separate diagnostic defect. No realm rollout or full guest build is established. - Parent work: https://git.erikinkinen.fi/erix/integration/issues/2 and https://git.erikinkinen.fi/erix/docs/issues/1. - Branch: `feature/posix-compat`; update linked WIP PRs after coherent signed checkpoints using canonical CONTRIBUTING.md messages. - Baseline revision: `55f2e5295adcff8215269ff694aabb85a276f122`; refresh component/dependency heads and their own CI evidence as implementation advances. - Cross-repository dependencies remain full lowercase commit hashes; update the selected graph deliberately. This issue does not authorize merges, release tags or replacement of published images. Verified supervisor controller isolation and real AP scheduler observation — 24 September 2026: [Kernel](https://git.erikinkinen.fi/erix/kernel/commit/650cd1d62ae2847cf5a6d092bd276048a8f8b25c) and [Bootloader](https://git.erikinkinen.fi/erix/bootloader/commit/ed8ba424bf49ad09c154ca9116d653b63973ca51) remove the ordinary-domain controller alias conflict recorded in [the controller report](https://git.erikinkinen.fi/erix/kernel/issues/40). The original diagnostic confirms supervisor leaf replacement by owned RAM and exact restoration before complete temporary-owner cleanup; it does not claim an original CPL3 exploit or actual device access. The correction prepares one permanent supervisor Kernel-image alias before AP startup and baseline capture. Fixed-register views retain CPU-local interrupt custody and validate mode, physical identity, cache policy and the exact active leaf. They are neither Send nor Sync. Bootloader removes its low controller aliases and excludes interrupts before final CR3. Ordinary low-address RAM remains usable. The added four-CPU long-mode scenario exposed [premature scheduler observation](https://git.erikinkinen.fi/erix/kernel/issues/41). An observation-only diagnostic records 32 BSP switches, all tasks seen, three attached APs and zero AP switches. The corrected witness observes independent AP progress within a retained processor-clock deadline, with immediate errors and incomplete expiry preserved. State guards end before waiting. Simulated/trampoline workloads and original outer VM limits remain unchanged. Scheduler runtime, VM witnesses and host tests are separated into documented modules; three new controls cover delayed real scheduler counters, expiry and errors. Four strict Kernel configurations pass 914/938 tests with three existing ignored cases. Eighteen native build/binary Clippy profiles, formatting and host/native/long-mode private rustdoc pass without warnings. Bootloader passes all four host/UEFI configurations with 34 unit and seven standalone tests each, signing controls and four Python fixture suites. [Integration](https://git.erikinkinen.fi/erix/integration/commit/4149f332dce6567f8f2db0f503154d8980a52e48) selects the exact executable graph in all three catalogs; catalog/source checks pass and all 172 helper implementations and 100 Rust crate/fixture inputs retain their complete strict validation. The [manual](https://git.erikinkinen.fi/erix/docs/commit/8af70ddcf42cb60dbf5ed0952184f2bbac14fe77) passes 45 tests and all 2,445 pages; all 455,408 word bounds and changed page 2,424 are reviewed without final warnings or overflow. Static audit covers 3,259 authored code files below 1,000 lines, 75 manifests, 259 exact Git pins, 174 direct missing_docs gates and 93 conventional crate roots. Accepted document structures and canonical governance bytes remain intact. Ten exact-source native executions satisfy eleven maintained contracts: lifetime, mapping/isolation and sparse, owned invocation, both allocators, ordinary exec-successor and four SMP profiles. Both mapping contracts share one identical runtime capture with their separate maintained oracles. Actual CPL3 denies the high controller alias; controller reads and shared/private leaves remain correct through ordinary low-address RAM mapping, protection and disposal. Long-mode startup observes all three APs online with real attachment, switches and join. Every previous marker, grant, cleanup assertion and original 60/120-second deadline remains required. All fifteen native and 73 service signatures and original packaged artifacts verify without image warnings or QEMU stderr. Ordinary exec retains 106 artifact files and 56,616 serial bytes; its 48.284099-second complete build/run is not a speedup claim. The [original pre-entry startup-silence failure](https://git.erikinkinen.fi/erix/integration/issues/84) remains open. Its read-only QMP diagnostic and later changed-source bringup pass do not explain or repair it. No unchanged failed input was retried for acceptance. The three new reports use bug_report with applicable bug, security, ci, refactor and phase-6 labels; the two corrected defects remain open for publication CI review. 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. Owning [Kernel review](https://git.erikinkinen.fi/erix/kernel/pulls/3), [Bootloader review](https://git.erikinkinen.fi/erix/bootloader/pulls/3), [Integration review](https://git.erikinkinen.fi/erix/integration/pulls/12), [manual review](https://git.erikinkinen.fi/erix/docs/pulls/4) and [Phase 6 completion](https://git.erikinkinen.fi/erix/integration/issues/65) remain unfinished. [Owned address-space routing and residency](https://git.erikinkinen.fi/erix/kernel/issues/22), semantic authority and inline-documentation closure, and older CI regressions including [release physical-directory input](https://git.erikinkinen.fi/erix/integration/issues/83) remain open. Canonical acceptance remains 15/460 leaves, weighted 3.48%; external Rust/LLVM/runtime rebuilding inside EriX and both complete EriX guest-build generations remain mandatory and unproven.
erikinkinen changed title from [FEATURE] [P02.R03] Audit authority, code quality and documentation in bootloader to [FEATURE] Audit authority, code quality and documentation in bootloader 2026-09-12 08:02:10 +02:00
erikinkinen added this to the Alpha 1 milestone 2026-10-30 09:33:34 +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/bootloader#2
No description provided.