[FEATURE] Own process descriptors separately from shared open descriptions #15
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/posixd#15
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
The realm mediator currently couples initial descriptor numbers to immutable channel rows or inherited-stream selectors. Closing such a descriptor closes its original binding, and there is no mutable descriptor table or distinct shared open-file description. Real open/openat, dup/fcntl, redirected build subprocesses and later fork/exec need those ownership layers; another ad hoc bound-file operation cannot supply them.
Proposed behavior and scope
Implement counted per-process descriptor tables distinct from shared open-file descriptions. Descriptor rows retain exact client identity, local number and inheritance flags. Open descriptions retain original backend identity, access rights, shared status and the original offset owner, plus checked alias accounting. Internal channel ends remain nonseekable; native streams retain their actual provider-owned cursor rather than an invented or independently cached offset.
Reserve explicit runtime descriptor/description storage independently from the immutable initial binding count. Carry those counts through authenticated Launchd configuration, Procd provisioning, the target-generated arena layout, sealed startup and native intake. Allocation uses only this supplied storage, with lowest-free descriptor selection and no fixed fd-number or table limit beyond the ABI and configured resource envelope.
Route existing Read/Write/Close through the admitted descriptor table, then add duplication, exact atomic replacement and descriptor inheritance-flag queries/updates through actual sealed-client serving. Duplicates share one original backend and cursor; closing one alias does not close its siblings or lender. Last-alias closure retains provider/caller/local cleanup before publishing disposal. Reserve the source reference, target row and complete result before destructive replacement; cancellation, malformed replies and refused completion retain the original owners and never replay the mutation. The old direct immutable-descriptor dispatch must be removed after its callers are migrated.
This pass supplies the descriptor ownership prerequisite for dynamic open/openat, later process inheritance and broader filesystem mediation. It does not claim those later operations, blocking/readiness semantics or a full libc are already implemented. Existing nonblocking channel/stream behavior must be represented truthfully in shared status; no fake blocking success or offset is permitted.
Authority, security and reliability
Actual native CLAIM and the original sealed process generation select the process table. Descriptor numbers, open-description IDs and inheritance flags are descriptive only. A duplicate may alias only an already admitted description of that process; it cannot select another client's provider or add rights. Global arena storage is an explicit realm resource, never authority to another process's rows. Local number reuse must not satisfy an older pending cleanup token.
Prospective replacement and final close remain noncopyable counted owners until their original backend obligations finish. Provider and native transport cleanup are separate from local reference-count changes. Unknown effects or uncertain cleanup fail stopped with retained state. Full-window inventory and sealed startup remain mandatory. Fork/exec will require their own authenticated process transition before inheritance flags can produce any transfer.
Acceptance criteria
Checklist
Alternatives and tradeoffs
Reusing immutable plan records as mutable fd slots would lose provenance and cannot represent aliases safely. Guessing a larger static table or borrowing result buffers would bypass explicit capacity and target geometry. Duplicating native streams for every dup would give aliases separate ownership/cursors and close semantics. Keep process-local bindings and one shared original description as separate counted state; common lookups should use the maintained descriptor index rather than repeatedly scanning unrelated authorities.
The behavioral references are the Open Group contracts for dup, fcntl, open and close. EriX implementations remain original, and ABI values are explicitly assigned rather than copied from a foreign runtime.
Tracking and rollout
Process descriptor ownership — 29 September 2026: lib-ipc
9c0d1186, lib-posixabi7ae4eeed, posixd7c7e44d9, exsh7e35c918, launchd0cd8fcb5, procdbaece044, loaderd12928160, docs0d79a212, integration2537a103, rootd735a5325.The descriptor ownership feature now separates process-local numbers and inheritance flags from shared original backend/access/status/cursor ownership. Native sealed-client intake resolves aliases before selecting the original provider. Full-width lowest-free and exact duplication preserve shared offsets and independent flags; same-fd dup2 preserves its binding and dup3 rejects equality. Compatibility 1.4 defines exact Duplicate, DescriptorFlags and OpenStatus bodies alongside existing bound-filesystem operations.
Explicit runtime capacity F passes through configuration/provisioning and the version-three target layout. Initial channel/stream descriptions must fit F; mutable fd and shared-description rows remain separate from immutable plan records. Last Close and target replacement retain their original source holds, provider call and local cleanup through cancellation and refused completion. Terminal disposal remembers each positive source disposition before compacting aliases. Exhausted generations still permit final release. No additional native grant, implicit resource budget or numeric-gap scan is introduced.
Twenty-five new host controls are authored and unrun: three shared-IPC, five compatibility-codec, eleven descriptor-owner, five actual-serving and one channel-adapter controls. Native reciprocal clients close initial numbers and exchange data through aliases; the binding workload continues through the original provider cursor after closing its original fd. Explicit F=8/F=10 and 808/3112 two-plan extents preserve existing resource and lifecycle gates. Nested witness module paths and independent binding transcript counts are corrected, based on formatter/source observations without an inferred compiler or test failure.
The coherent graph comprises 55 repositories and 56 signed commits, with 206 Cargo and 111 catalog selectors updated. Rootd and both helper catalogs retain the independent Rust helper
eacd21f4, separate from the final catalog head. Component contracts, API-reference source and maintained manual TeX are updated; rustfmt was applied. Read-only inventory covers 3402 source files in 76 repositories, all below one thousand lines; the largest changed source has 630 lines.Authenticated fork/exec, both full EriX guest-build generations and the external Rust/LLVM guest rebuild remain unfinished.
Reviews: native wire, compatibility wire, consumer, workload producer, Launchd, Procd, Loaderd, manual, Integration. Recomputed completion is 16.91% weighted, 5.21% whole-item, 21/460 parents, and 441/902 sub-items. Existing section and parent weights are unchanged.
Owning review: #5. Related permission work: #10 and #14. Coordinated producers: erix/launchd#2 and erix/procd#2. Shared contracts: erix/lib-ipc#2 and erix/lib-posixabi#3. Phase completion: erix/integration#65.
Both complete EriX guest-build generations and the external Rust/LLVM guest rebuild remain unfinished functional requirements.
erikinkinen referenced this issue from erix/blockd2026-09-29 18:25:07 +02:00
erikinkinen referenced this issue from erix/coreutils2026-09-29 18:25:12 +02:00
erikinkinen referenced this issue from erix/crashd2026-09-29 18:25:14 +02:00
erikinkinen referenced this issue from erix/deviced2026-09-29 18:25:17 +02:00
erikinkinen referenced this issue from erix/docs2026-09-29 18:25:23 +02:00
erikinkinen referenced this issue from erix/drv-acpi2026-09-29 18:25:35 +02:00
erikinkinen referenced this issue from erix/drv-i80422026-09-29 18:25:41 +02:00
erikinkinen referenced this issue from erix/drv-ps2-keyboard2026-09-29 18:25:48 +02:00
erikinkinen referenced this issue from erix/drv-ps2-mouse2026-09-29 18:25:52 +02:00
erikinkinen referenced this issue from erix/drv-rtc-cmos2026-09-29 18:25:57 +02:00
erikinkinen referenced this issue from erix/drv-serial2026-09-29 18:26:01 +02:00
erikinkinen referenced this issue from erix/drv-virtio-block2026-09-29 18:26:04 +02:00
erikinkinen referenced this issue from erix/dynlinkd2026-09-29 18:26:13 +02:00
erikinkinen referenced this issue from erix/e2fsd2026-09-29 18:26:19 +02:00
erikinkinen referenced this issue from erix/exsh2026-09-29 18:26:25 +02:00
erikinkinen referenced this issue from erix/extop2026-09-29 18:26:33 +02:00
erikinkinen referenced this issue from erix/fatd2026-09-29 18:26:42 +02:00
erikinkinen referenced this issue from erix/fbcond2026-09-29 18:26:47 +02:00
erikinkinen referenced this issue from erix/hotplugd2026-09-29 18:26:52 +02:00
erikinkinen referenced this issue from erix/inputd2026-09-29 18:27:00 +02:00
erikinkinen referenced this issue from erix/integration2026-09-29 18:27:07 +02:00
erikinkinen referenced this issue from erix/irqd2026-09-29 18:27:13 +02:00
erikinkinen referenced this issue from erix/kernel2026-09-29 18:27:21 +02:00
erikinkinen referenced this issue from erix/keyd2026-09-29 18:27:24 +02:00
erikinkinen referenced this issue from erix/launchd2026-09-29 18:27:27 +02:00
erikinkinen referenced this issue from erix/lib-block2026-09-29 18:27:27 +02:00
erikinkinen referenced this issue from erix/lib-bootstrap2026-09-29 18:27:28 +02:00
erikinkinen referenced this issue from erix/lib-capabi2026-09-29 18:27:29 +02:00
erikinkinen referenced this issue from erix/lib-driver2026-09-29 18:27:30 +02:00
erikinkinen referenced this issue from erix/lib-input2026-09-29 18:27:31 +02:00
erikinkinen referenced this issue from erix/lib-interrupt2026-09-29 18:27:32 +02:00
erikinkinen referenced this issue from erix/lib-ipc2026-09-29 18:27:33 +02:00
erikinkinen referenced this issue from erix/lib-log2026-09-29 18:27:33 +02:00
erikinkinen referenced this issue from erix/lib-posixabi2026-09-29 18:27:36 +02:00
erikinkinen referenced this issue from erix/lib-service2026-09-29 18:27:36 +02:00
erikinkinen referenced this issue from erix/lib-stdio2026-09-29 18:27:37 +02:00
erikinkinen referenced this issue from erix/lib-time2026-09-29 18:27:38 +02:00
erikinkinen referenced this issue from erix/lib-tty2026-09-29 18:27:39 +02:00
erikinkinen referenced this issue from erix/lib-vfs2026-09-29 18:27:40 +02:00
erikinkinen referenced this issue from erix/loaderd2026-09-29 18:27:40 +02:00
erikinkinen referenced this issue from erix/logd2026-09-29 18:27:41 +02:00
erikinkinen referenced this issue from erix/memd2026-09-29 18:27:41 +02:00
erikinkinen referenced this issue from erix/named2026-09-29 18:27:42 +02:00
erikinkinen referenced this issue from erix/pagerd2026-09-29 18:27:42 +02:00
erikinkinen referenced this issue2026-09-29 18:27:43 +02:00
erikinkinen referenced this issue from erix/powerboxd2026-09-29 18:27:44 +02:00
erikinkinen referenced this issue from erix/probed2026-09-29 18:27:45 +02:00
erikinkinen referenced this issue from erix/procd2026-09-29 18:27:45 +02:00
erikinkinen referenced this issue from erix/ramfsd2026-09-29 18:27:46 +02:00
erikinkinen referenced this issue from erix/rootd2026-09-29 18:27:47 +02:00
erikinkinen referenced this issue from erix/seriald2026-09-29 18:27:48 +02:00
erikinkinen referenced this issue from erix/timed2026-09-29 18:27:48 +02:00
erikinkinen referenced this issue from erix/ttyd2026-09-29 18:27:49 +02:00
erikinkinen referenced this issue from erix/vfsd2026-09-29 18:27:49 +02:00
erikinkinen referenced this issue from erix/vspaced2026-09-29 18:27:50 +02:00