[FEATURE] Retain authentic prepared native process members #46

Closed
opened 2026-10-04 15:33:05 +02:00 by erikinkinen · 0 comments
Owner

Problem and motivation

The complete OIR2 producer/consumer migration exports authentic original process and execution keys, but native process storage still admits only its initial execution. Additional native records must share actual process custody through an original constrained constructor, with separate cleanup that cannot purge their shared CSpace or backing.

Proposed behavior and scope

Implement actual prepared native member custody as the next mechanism in the authenticated process/thread ownership contract. A noncopy Kernel-owned prepared-member factory is bound to one original process and an explicit u64 total occupation budget, including its initial execution. Creation requires actual Running caller custody, held Process SEND and an actual exact-stage install grant naming a Created original initial process. The grant supplies target evidence, never Process authority. No authority is inferred from current TCB, process ID or copied metadata.

Keep one actual process owner and one VSpace reference. Admit additional distinct original TCB/generation records through that factory into an indexed original membership directory, with the same actual CSpace/VSpace/root associations and sole process window. Reserve all publication storage before native membership effects. Factory and member views are noncopy; dropping a view does not forget Kernel-owned preparation or charge. Explicit member abort withdraws only its unstarted execution and original charge; it never removes shared caps/mappings, revokes process grants, emits a process event or releases group backing.

Factory release refuses while its prepared members remain. Closing/final process cleanup prevents new preparation and drains every original unstarted member before shared authority/backing disposal. Generic initial Start, window mutation, child binding, process termination and destruction cannot treat an additional member as an independent process. Admission validation stays indexed rather than scanning all peers on every IPC lookup.

This is an actual Kernel preparation and retention mechanism. It does not publish a userspace factory wire/capability carrier or permit new members to run before required original context, memory/TLS and mediator enrollment exist. Full prepare/start carriers, running peer lifecycle, departed-leader survival, join/detach, masks/TLS and imported consumers remain mandatory in the native implementation; no prepared-record or host fixture substitutes for their genuine native execution.

Authority, security and reliability

Validate the held Process endpoint's actual native kind, SEND right and current original window. Validate the exact install-grant custodian and original stage target. Factory keys contain no payload-selected CSpace or additional root, Process, MAP, receiver or provider grant. The factory's original process association, generation and nonwrapping factory occupation must match at every prepare/release. Prepared handles identify only their original member and abort permission; they cannot select a replacement or Start through the ordinary initial process path.

Retain original owners through denied capacity, storage exhaustion, stale or foreign keys, group terminality and final backing-release failure. Native membership, factory charge and TCB identity publish and retire together under existing lifecycle/TCB-to-process locks. Positive member withdrawal precedes native-ID reuse. Initial process backing stays retained until positive final release. Freeze/drain occurs before shared inventory disposal. Copied execution snapshots still cannot enroll a member.

Acceptance criteria

Checklist
  • Implement indexed original process/member custody with one actual VSpace reference and shared sole process policy.
  • Implement noncopy process-bound prepared factory creation using actual held Process authority and exact original stage evidence with explicit occupation budgets.
  • Reserve actual TCB/member storage before preparation, reject stale/foreign/zero/exhausted authority or capacity, and preserve original owners through refusal.
  • Implement member-only positive unstarted withdrawal, retained factory release and group cleanup before shared CSpace/VSpace disposal.
  • Prevent additional prepared members entering initial Start/window/child/process cleanup paths; author independent actual-object, authority/capacity/allocation/refusal/reuse/final-release controls.
  • Maintain inline/component/manual contracts, code-size/missing-docs policy, signed immutable adoption, owning reviews and phase tracking while keeping genuine running-thread requirements open.

Alternatives and tradeoffs

An indexed membership directory gives bounded identity validation without copying capability policy per thread or scanning a growing peer list on each invocation. Prepared members already share real process objects and original Kernel custody; a runnable member requires the remaining full context and enrollment transaction. Keeping that admission boundary explicit avoids disguising a staged record as executed shared-process threading.

Tracking and rollout

Ownership specification, native implementation, authenticated origins, socket/thread consumers, phase completion. Implement genuine original preparation/custody, separate positive abort and original group drain, author independent controls and maintain contracts, then publish and reconcile. Continue full factory/start/context/enrollment and runtime consumers afterward. Testing, builds and CI observation remain deferred; no compiler/runtime/profiling or guest-build result is claimed.

Original prepared native member custody — 4 October 2026

A noncopy process-bound Kernel factory requires actual held Process SEND of native Process kind in the Running caller's window plus an actual exact-stage GRANT install grant naming a Created initial process. The grant supplies target evidence, never Process authority; scope and rights remain unchanged. An explicit u64 total occupation budget includes the initial execution, and zero/exhausted capacity refuses.

Stale or exhausted factory admission refuses before prospective ID/global execution generation allocation. Native keys and factory serials never wrap. Parsed metadata, copied snapshots, ordinary endpoints, inert rights, foreign/stale targets and outside-window grants cannot authorize creation.

Factory release refuses until preparations withdraw, preserving the original view and quota. Old member/factory observations cannot dispose replacement occupations. Group terminal/cleanup freezes admission and preflights/drains original preparations before shared inventory effects; a refused final backing release retains the original process owner/reference and cleanup-only initial record for retry. Additional preparations cannot enter legacy initial Start/current-context/window/receiver/child/process mapping/write, install/revocation target, dynamic-link cleanup, CPU-time or process termination/destruction paths. Created native activity notifications have no effects.

Nine independent actual-object controls are authored and unrun: shared objects/window and total capacity; native authority negatives; legacy initial-path/copied-peer refusal; member/factory reuse; actual TCB/member allocation failure; dropped member views and final release failure; group terminality and one event; dropped factory retention; nonpristine refusal and exact cleanup retry.

No userspace factory capability/wire carrier or runnable member is published. Genuine Start/context, original stack/TLS, mediator enrollment, running-peer scheduling, thread-only exit, departed-leader survival, join/detach, whole-group CPU aggregation, per-thread masks and libc/imported consumers remain mandatory and open. Both full EriX guest generations and external Rust/LLVM rebuilding inside EriX remain required and unperformed.

Checklist acceptance records source implementation under the testing waiver.

All six declared prepared-custody source criteria are complete. Required runnable native membership and execution evidence stay open in the linked implementation and phase issues.

Related records and contracts
Repository Links
docs PR 4
dynlinkd issue 1
integration PR 12
kernel issue 46, PR 3, prepared-native-members.md
lib-cstd issue 1
## Problem and motivation The complete OIR2 producer/consumer migration exports authentic original process and execution keys, but native process storage still admits only its initial execution. Additional native records must share actual process custody through an original constrained constructor, with separate cleanup that cannot purge their shared CSpace or backing. ## Proposed behavior and scope Implement actual prepared native member custody as the next mechanism in the authenticated process/thread ownership contract. A noncopy Kernel-owned prepared-member factory is bound to one original process and an explicit u64 total occupation budget, including its initial execution. Creation requires actual Running caller custody, held Process SEND and an actual exact-stage install grant naming a Created original initial process. The grant supplies target evidence, never Process authority. No authority is inferred from current TCB, process ID or copied metadata. Keep one actual process owner and one VSpace reference. Admit additional distinct original TCB/generation records through that factory into an indexed original membership directory, with the same actual CSpace/VSpace/root associations and sole process window. Reserve all publication storage before native membership effects. Factory and member views are noncopy; dropping a view does not forget Kernel-owned preparation or charge. Explicit member abort withdraws only its unstarted execution and original charge; it never removes shared caps/mappings, revokes process grants, emits a process event or releases group backing. Factory release refuses while its prepared members remain. Closing/final process cleanup prevents new preparation and drains every original unstarted member before shared authority/backing disposal. Generic initial Start, window mutation, child binding, process termination and destruction cannot treat an additional member as an independent process. Admission validation stays indexed rather than scanning all peers on every IPC lookup. This is an actual Kernel preparation and retention mechanism. It does not publish a userspace factory wire/capability carrier or permit new members to run before required original context, memory/TLS and mediator enrollment exist. Full prepare/start carriers, running peer lifecycle, departed-leader survival, join/detach, masks/TLS and imported consumers remain mandatory in the native implementation; no prepared-record or host fixture substitutes for their genuine native execution. ## Authority, security and reliability Validate the held Process endpoint's actual native kind, SEND right and current original window. Validate the exact install-grant custodian and original stage target. Factory keys contain no payload-selected CSpace or additional root, Process, MAP, receiver or provider grant. The factory's original process association, generation and nonwrapping factory occupation must match at every prepare/release. Prepared handles identify only their original member and abort permission; they cannot select a replacement or Start through the ordinary initial process path. Retain original owners through denied capacity, storage exhaustion, stale or foreign keys, group terminality and final backing-release failure. Native membership, factory charge and TCB identity publish and retire together under existing lifecycle/TCB-to-process locks. Positive member withdrawal precedes native-ID reuse. Initial process backing stays retained until positive final release. Freeze/drain occurs before shared inventory disposal. Copied execution snapshots still cannot enroll a member. ## Acceptance criteria <details> <summary>Checklist</summary> - [x] Implement indexed original process/member custody with one actual VSpace reference and shared sole process policy. - [x] Implement noncopy process-bound prepared factory creation using actual held Process authority and exact original stage evidence with explicit occupation budgets. - [x] Reserve actual TCB/member storage before preparation, reject stale/foreign/zero/exhausted authority or capacity, and preserve original owners through refusal. - [x] Implement member-only positive unstarted withdrawal, retained factory release and group cleanup before shared CSpace/VSpace disposal. - [x] Prevent additional prepared members entering initial Start/window/child/process cleanup paths; author independent actual-object, authority/capacity/allocation/refusal/reuse/final-release controls. - [x] Maintain inline/component/manual contracts, code-size/missing-docs policy, signed immutable adoption, owning reviews and phase tracking while keeping genuine running-thread requirements open. </details> ## Alternatives and tradeoffs An indexed membership directory gives bounded identity validation without copying capability policy per thread or scanning a growing peer list on each invocation. Prepared members already share real process objects and original Kernel custody; a runnable member requires the remaining full context and enrollment transaction. Keeping that admission boundary explicit avoids disguising a staged record as executed shared-process threading. ## Tracking and rollout [Ownership specification](https://git.erikinkinen.fi/erix/kernel/issues/44), [native implementation](https://git.erikinkinen.fi/erix/kernel/issues/1), [authenticated origins](https://git.erikinkinen.fi/erix/lib-ipc/issues/5), [socket/thread consumers](https://git.erikinkinen.fi/erix/posixd/issues/34), [phase completion](https://git.erikinkinen.fi/erix/integration/issues/65). Implement genuine original preparation/custody, separate positive abort and original group drain, author independent controls and maintain contracts, then publish and reconcile. Continue full factory/start/context/enrollment and runtime consumers afterward. Testing, builds and CI observation remain deferred; no compiler/runtime/profiling or guest-build result is claimed. ### Original prepared native member custody — 4 October 2026 A noncopy process-bound Kernel factory requires actual held Process SEND of native Process kind in the Running caller's window plus an actual exact-stage GRANT install grant naming a Created initial process. The grant supplies target evidence, never Process authority; scope and rights remain unchanged. An explicit u64 total occupation budget includes the initial execution, and zero/exhausted capacity refuses. Stale or exhausted factory admission refuses before prospective ID/global execution generation allocation. Native keys and factory serials never wrap. Parsed metadata, copied snapshots, ordinary endpoints, inert rights, foreign/stale targets and outside-window grants cannot authorize creation. Factory release refuses until preparations withdraw, preserving the original view and quota. Old member/factory observations cannot dispose replacement occupations. Group terminal/cleanup freezes admission and preflights/drains original preparations before shared inventory effects; a refused final backing release retains the original process owner/reference and cleanup-only initial record for retry. Additional preparations cannot enter legacy initial Start/current-context/window/receiver/child/process mapping/write, install/revocation target, dynamic-link cleanup, CPU-time or process termination/destruction paths. Created native activity notifications have no effects. Nine independent actual-object controls are authored and unrun: shared objects/window and total capacity; native authority negatives; legacy initial-path/copied-peer refusal; member/factory reuse; actual TCB/member allocation failure; dropped member views and final release failure; group terminality and one event; dropped factory retention; nonpristine refusal and exact cleanup retry. No userspace factory capability/wire carrier or runnable member is published. Genuine Start/context, original stack/TLS, mediator enrollment, running-peer scheduling, thread-only exit, departed-leader survival, join/detach, whole-group CPU aggregation, per-thread masks and libc/imported consumers remain mandatory and open. Both full EriX guest generations and external Rust/LLVM rebuilding inside EriX remain required and unperformed. Checklist acceptance records source implementation under the testing waiver. All six declared prepared-custody source criteria are complete. Required runnable native membership and execution evidence stay open in the linked implementation and phase issues. <details> <summary>Related records and contracts</summary> | Repository | Links | | --- | --- | | docs | [PR 4](https://git.erikinkinen.fi/erix/docs/pulls/4) | | dynlinkd | [issue 1](https://git.erikinkinen.fi/erix/dynlinkd/issues/1) | | integration | [PR 12](https://git.erikinkinen.fi/erix/integration/pulls/12) | | kernel | [issue 46](https://git.erikinkinen.fi/erix/kernel/issues/46), [PR 3](https://git.erikinkinen.fi/erix/kernel/pulls/3), [prepared-native-members.md](https://git.erikinkinen.fi/erix/kernel/src/branch/feature/posix-compat/docs/prepared-native-members.md) | | lib-cstd | [issue 1](https://git.erikinkinen.fi/erix/lib-cstd/issues/1) | </details>
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#46
No description provided.