[FEATURE] Specify authenticated process and thread ownership #44
Labels
No labels
alpha-1
bug
ci
docs
duplicate
enhancement
help wanted
invalid
performance
phase-6
question
refactor
security
wontfix
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
erix/kernel#44
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem and motivation
Parallel guest compiler/runtime consumers need genuine threads in one native process. Current kernel CLAIM attests one TCB and generation, while ordinary terminal/destruction paths retire that TCB's process authority. Counted same-ingress asynchronous calls already coexist, but cannot supply shared-process membership, independent thread masks/TLS, join or detach semantics.
Proposed behavior and scope
Publish the complete native process/thread ownership contract before changing ABI or runtime mechanisms. Define one original process lifetime with shared CSpace/VSpace and process policy, separate authenticated thread occupations, explicit construction authority and actual resource admission, start publication, thread exit versus process exit, exclusive join/detach, stack/TLS ownership and failure cleanup. Specify counted native origin framing and mediator enrollment without payload-derived thread authority. Document the implementation and producer/consumer sequence, including removal of obsolete singleton assumptions. This issue accepts the specification; runtime implementation remains tracked by the memory/runtime and local-socket designs.
Authority, security and reliability
Only an explicitly held, original-group-bound factory may construct members. Exact thread handles authorize their declared operations; numeric identities and packet bytes authorize nothing. Threads intentionally share their process's existing capability ceiling and mappings without minting root, Process, MAP or receiver authority. Thread exit retires its own original callers and execution storage; peers and process resources survive. Whole-process retirement drains every original thread/call before revoking group authority. Preserve nonwrapping generations, actual storage refusal before effects, original cleanup through uncertainty and strict W^X. Security, reliability and performance retain that priority.
Acceptance criteria
Checklist
Alternatives and tradeoffs
Reject payload thread IDs, separate processes relabeled as a shared process, duplicated ClientSlot policy and receiver grants, ambient self-construction, spin-only joins and early stack/handle recycling. Retain the current scheduler's admitted execution placement; do not invent CPU authority. A shared process is one security domain, so capability sharing must be explicit rather than falsely described as isolation between peers. Runtime behavior and full imported-tool requirements remain implementation work.
Tracking and rollout
Memory/TLS/thread implementation, socket/runtime consumers, process behavior, libc, compatibility ELF/TLS and phase completion. Kernel, LibIPC, Posixd, Procd, loader/linker, memory services, libc and Integration must adopt the eventual native mechanism coherently. Tests, builds, lint, generated documentation, VM/profiler execution and CI observation remain deferred. Neither runtime thread support nor guest-build completion is claimed by specification acceptance.
Detailed scope and contracts
Native process/thread ownership specification — 4 October 2026
The complete ownership specification defines one original process with shared CSpace/VSpace, capability/fd/action/cwd/creation-mask policy and distinct authenticated native execution occupations. An explicitly sealed original-process factory and retained thread handles authorize Prepare/Start and cleanup; clients gain no global Process route, root or MAP grant. The actual original creator and counted enrollment precede Start. Native membership and caller origin never come from payload labels or copied ClientSlot policy.
The contract separates thread-only exit from process exit. Initial-thread departure preserves peers and shared resources. Last-thread preparation serializes creation/Start, settles potentially startable original members and retains the final context for process finalization. Whole-group retirement drains every original member/provider before shared authority reclamation and emits one process event. Join/detach arbitrate one original target, preserve joinability on cancelled uncommitted joins and reconcile committed disposition through reply loss without affecting a replacement generation.
Stack/guard, caller-owned storage, TLS/errno/module/destructor and complete architecture state have explicit original lifetime and reclamation boundaries. Current OIR1's 64-byte header uses bytes 56–63 for terminal status; the proposed versioned OIR2 extent is 72 bytes, adding thread identity/generation at 64–71. No runtime ABI/codec is changed by this specification. Mediator process policy remains shared while real enrolled threads own distinct masks/handlers. Fork/exec, native provisioning, target geometry, memory/loader/linker/libc and real workload adoption are coordinated requirements.
Integration's native lifecycle contract records independent actual membership, blocked-peer progress, initial/last exit, TLS/context, guards, join/detach, failure/reuse, group loss, profiling and tool-consumer evidence. The imported-tool source/version/options and transitive interface matrix remains unresolved. Current one-TCB asynchronous calls do not implement native shared-process threads.
Specification acceptance completes the ownership specification only. Native process/member/factory/origin mechanisms, thread-only exit, join/detach, per-thread TLS, libc/imported consumers and real profiling remain open. Both complete EriX guest generations and external Rust/LLVM rebuilding inside EriX remain required and unperformed.
Three signed commits across Kernel, Docs and Integration publish 17 paths: 14 maintained documentation sources and three catalog files containing four selector updates. No runtime or Cargo source changes; no Rustfmt inputs. Read-only source/Git inventory records all 269 compiled edges and 162 catalog selections coherent, 4,346 code files below 1,000 lines, retained missing-docs gates, and 153 guards across 76 workflows. All 76 feature trees are clean except preserved Meta cache. Rootd and helper catalog entries retain independent compiled helper
cc878220040dfa741491249434d6b8f8fe2252f7.Signed documentation/adoption: docs af376f65, integration 5daf30c3, kernel 9660dacf.
Tracking: ownership specification, native implementation, socket consumers, libc, compatibility ELF/TLS, phase completion.
The complete ownership specification is source-accepted. Every native runtime, thread/TLS, imported consumer, profiling and guest-build implementation/evidence requirement retains its existing open scope.
Related records and contracts
erikinkinen referenced this issue2026-10-04 13:21:28 +02:00
erikinkinen referenced this issue from erix/docs2026-10-04 13:21:29 +02:00
erikinkinen referenced this issue from erix/integration2026-10-04 13:21:29 +02:00
erikinkinen referenced this issue from erix/lib-cstd2026-10-04 13:21:32 +02:00