[FEATURE] Counted object names in the boot handoff #5

Open
opened 2026-11-08 09:33:05 +01:00 by erikinkinen · 0 comments
Owner

Problem and motivation

The current boot catalog stores object names in 64-byte arrays. The release image has 49 DSO names of 85–109 bytes, so EFI reaches Kernel entry readiness but rejects the catalog before entering the Kernel.

Proposed behavior and scope

Introduce a Bootloader-to-Kernel handoff V2. Each object carries a checked offset and length into the retained, authenticated dynamic-link store. Dependency edges identify their target by object index; they do not duplicate names. Preserve full identities without truncation or a replacement string-size ceiling.

Migrate LibHandoff, Bootloader, Kernel and Rootd together. Keep the separate Kernel-to-Rootd handoff protocol unchanged.

Mapping requests also have a 64-byte name-pointer limit. Replace that pointer selector with a catalog-index mode on the existing kernel-control operation: flag bit 1 selects an index in arg1, arg2 must be zero, and bit 0 continues to select whole-graph mapping. Reject the retired pointer modes. Rootd obtains the ordinal from its original authenticated store enumeration; Kernel resolves it only against its validated, retained catalog. This removes the name ceiling without accepting arbitrary long caller pointers or introducing another operation permission.

Procd also has three catalog mapping callers and a fixed-name staged-map request. Migrate staged mapping to a V2 request carrying the explicit catalog index already retained by Rootd. Preserve staged-process generation and caller authority checks.

Driver launch retains its existing executable-name policy. Resolve that name through a read-only catalog lookup on the same kernel-control operation: query flag 4, zero reserved arguments, and a counted UTF-8 name carried in the validated IPC payload after the fixed request prefix. The query returns the matching retained catalog index without mapping an object or reading a separate caller pointer. Procd then maps the returned index with the existing checked index mode. This preserves exact name policy without giving Procd a boot-store mapping, inferring ordinals from driver roles or introducing a registration service.

Authority, security and reliability

An offset grants no access by itself. Consumers resolve names only against their actual retained store, check range arithmetic, UTF-8, nonempty names and embedded NULs before publishing mappings, and preserve exact identity and dependency checks. Store custody and lifetime remain explicit. Reject incompatible versions and malformed ranges without partial publication. Do not allocate a second name pool or recover ownership from serialized fields.

Acceptance criteria

  • Replace the fixed-name Bootloader-to-Kernel wire records and migrate all producers and consumers.
  • Cover names longer than 64, 128 and 1,024 bytes, malformed ranges, overflow, invalid UTF-8, empty names, NULs, duplicate identities and invalid dependency indices.
  • Reject incompatible wire versions and preserve the separate Kernel-to-Rootd protocol.
  • Migrate Rootd mapping calls and Kernel dispatch to the catalog-index selector, document shared flags in LibIPC, and reject retired pointer selectors, unknown flags, nonzero reserved arguments and invalid indices.
  • Migrate every Procd producer, including integration stress, using indexed staged-map V2 requests and the read-only counted IPC lookup; preserve driver-name policy, staged ownership, rejection and cleanup behavior.
  • Update architecture, interface documentation and the technical manual.
  • Boot a coherently selected image past catalog admission, then run the affected guest acceptance cases.

Alternatives and tradeoffs

Larger fixed arrays retain an arbitrary limit. Truncation loses identity. Renaming packages to fit the wire format imposes a packaging constraint without fixing the interface. Counted spans reuse the already retained authenticated bytes and avoid extra copies; they require coordinated version migration and careful bounds checks.

Tracking and rollout

Build on the runtime-symbol fix and dependency-order repair. Publish coordinated component branches and select their exact revisions together before producing the next image. Remove superseded Bootloader-to-Kernel APIs during migration.

The retained-source cohort uses LibHandoff #9, LibIPC #194, Bootloader #29 and Kernel #139. Kernel #139 replaces the closed descriptor-address consumer in Kernel #127; image and guest acceptance remain required.

## Problem and motivation The current boot catalog stores object names in 64-byte arrays. The release image has 49 DSO names of 85–109 bytes, so EFI reaches Kernel entry readiness but rejects the catalog before entering the Kernel. ## Proposed behavior and scope Introduce a Bootloader-to-Kernel handoff V2. Each object carries a checked offset and length into the retained, authenticated dynamic-link store. Dependency edges identify their target by object index; they do not duplicate names. Preserve full identities without truncation or a replacement string-size ceiling. Migrate LibHandoff, Bootloader, Kernel and Rootd together. Keep the separate Kernel-to-Rootd handoff protocol unchanged. Mapping requests also have a 64-byte name-pointer limit. Replace that pointer selector with a catalog-index mode on the existing kernel-control operation: flag bit 1 selects an index in `arg1`, `arg2` must be zero, and bit 0 continues to select whole-graph mapping. Reject the retired pointer modes. Rootd obtains the ordinal from its original authenticated store enumeration; Kernel resolves it only against its validated, retained catalog. This removes the name ceiling without accepting arbitrary long caller pointers or introducing another operation permission. Procd also has three catalog mapping callers and a fixed-name staged-map request. Migrate staged mapping to a V2 request carrying the explicit catalog index already retained by Rootd. Preserve staged-process generation and caller authority checks. Driver launch retains its existing executable-name policy. Resolve that name through a read-only catalog lookup on the same kernel-control operation: query flag 4, zero reserved arguments, and a counted UTF-8 name carried in the validated IPC payload after the fixed request prefix. The query returns the matching retained catalog index without mapping an object or reading a separate caller pointer. Procd then maps the returned index with the existing checked index mode. This preserves exact name policy without giving Procd a boot-store mapping, inferring ordinals from driver roles or introducing a registration service. ## Authority, security and reliability An offset grants no access by itself. Consumers resolve names only against their actual retained store, check range arithmetic, UTF-8, nonempty names and embedded NULs before publishing mappings, and preserve exact identity and dependency checks. Store custody and lifetime remain explicit. Reject incompatible versions and malformed ranges without partial publication. Do not allocate a second name pool or recover ownership from serialized fields. ## Acceptance criteria - [x] Replace the fixed-name Bootloader-to-Kernel wire records and migrate all producers and consumers. - [x] Cover names longer than 64, 128 and 1,024 bytes, malformed ranges, overflow, invalid UTF-8, empty names, NULs, duplicate identities and invalid dependency indices. - [x] Reject incompatible wire versions and preserve the separate Kernel-to-Rootd protocol. - [x] Migrate Rootd mapping calls and Kernel dispatch to the catalog-index selector, document shared flags in LibIPC, and reject retired pointer selectors, unknown flags, nonzero reserved arguments and invalid indices. - [x] Migrate every Procd producer, including integration stress, using indexed staged-map V2 requests and the read-only counted IPC lookup; preserve driver-name policy, staged ownership, rejection and cleanup behavior. - [x] Update architecture, interface documentation and the technical manual. - [ ] Boot a coherently selected image past catalog admission, then run the affected guest acceptance cases. ## Alternatives and tradeoffs Larger fixed arrays retain an arbitrary limit. Truncation loses identity. Renaming packages to fit the wire format imposes a packaging constraint without fixing the interface. Counted spans reuse the already retained authenticated bytes and avoid extra copies; they require coordinated version migration and careful bounds checks. ## Tracking and rollout Build on [the runtime-symbol fix](https://git.erikinkinen.fi/erix/bootloader/pulls/23) and [dependency-order repair](https://git.erikinkinen.fi/erix/integration/pulls/588). Publish coordinated component branches and select their exact revisions together before producing the next image. Remove superseded Bootloader-to-Kernel APIs during migration. The retained-source cohort uses [LibHandoff #9](https://git.erikinkinen.fi/erix/lib-handoff/pulls/9), [LibIPC #194](https://git.erikinkinen.fi/erix/lib-ipc/pulls/194), [Bootloader #29](https://git.erikinkinen.fi/erix/bootloader/pulls/29) and [Kernel #139](https://git.erikinkinen.fi/erix/kernel/pulls/139). Kernel #139 replaces the closed descriptor-address consumer in Kernel #127; image and guest acceptance remain required.
erikinkinen added this to the Alpha 1 milestone 2026-11-08 09:33:05 +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/lib-handoff#5
No description provided.