[FEATURE] Load compatibility ELF, TLS, constructors and declared runtime modules safely #1
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/dynlinkd#1
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
Imported runtimes emit TLS, constructors, exceptions and library features beyond the native abort-only artifact policy. Supporting them requires a distinct verified contract rather than removing native loader guards.
Proposed behavior and scope
Inventory the exact toolchain’s ELF features and implement bounded relocations, symbol rules, TLS/module lifecycle, constructor/finalizer order, declared runtime loading and compatibility-only unwind registration. Run actual C++/Rust runtime VMs alongside native-loader regressions.
This issue records planned work; its unchecked criteria are not implementation proof. The normative basis is Phase 6 and AC1–AC24.
Authority, security and reliability
Validate complete signed module identity and dependency closure before initialization. Confine library lookup to granted roots, preserve W^X/RELRO and exact mapped object identity, and retire mappings only after their users are gone. Unsupported dangerous binding modes require separate design and evidence.
Apply the priority order: security, reliability, then performance. Keep suspected vulnerabilities in the repository’s restricted SECURITY.md reporting channel.
Acceptance criteria
Checklist
models, constructor/finalizer and exception metadata from exact selected compiler/runtime
packages.
abort-only/no-TLS/no-init-fini policy; preserve rejection of unsupported native artifacts
instead of simply deleting existing guards.
dependency closure, cycle/duplicate behavior and no ambient library search.
template/BSS alignment, unload rules and kernel#1 synchronization.
handling; no initializer executes before validation and final mappings.
plugins/proc macros; restrict dlopen-like search to granted library roots and retire
mappings/aliases only after their users are gone.
validate metadata and keep native/kernel abort policy intact.
for imported objects; reject text relocation/lazy binding/ IFUNC modes unless separately
required, designed, tested and approved.
ambiguity, plugin teardown and out-of-realm library lookup.
regression scenarios with strict warning-free component CI.
For each implementation slice, retain actual formatting, strict Clippy, unit/doctest and warning-denied build results for all altered Rust repositories and valid configurations. Add relevant runtime VM coverage, monitor older unit/VM regressions in exact-head CI, and update canonical component documents and affected technical-manual/API material. Every authored code file must remain below 1,000 physical lines, with meaningful inline documentation and missing_docs enforcement in Rust crates.
Alternatives and tradeoffs
A permissive generic ELF loader would silently weaken the native contract. Version compatibility artifacts separately and admit only emitted features justified by the selected packages.
Matching catalog adoption and real consumer VMs remain requirements; complete realm and full in-guest build acceptance remain open.
Original coherent realm source CI acceptance — 18 September 2026: Signed
ff2cb5f2b8059c26d8e3bff990d0dba60100113epasses CI 40 and CI 39. Coherent catalog publication, actual consumer VMs and full guest-build acceptance remain separate open requirements.Tracking and rollout
All 34 maintained local checks pass: development/release feature matrices (15 unit tests per selection), strict host/native Clippy, warning-denied builds, private rustdoc, applicable doctests and component-specific checks, formatting and exact dependency-source validation. Native binaries have executable read-only entry pages and no writable executable pages. Original CI49 and CI50 pass; their complete logs are independently reviewed with zero warnings. No unchanged CI was rerun. Coordinated VM configuration/seal/four-client I/O, repeated managed-row reuse, profiler observation and both full builds inside EriX remain open under the phase checklist. This dependency work earns no separate feature-completion credit.
All 4 selected development/release configurations pass (13 unit tests per configuration). Strict host/native Clippy, warning-denied host/native builds, doctests where provided, private rustdoc, formatting, Markdown and dependency checks pass with zero warnings.
Matching-image native Posixd startup, two-realm independence and retirement acceptance remain pending. These local checks do not establish sealing, client I/O, a complete EriX guest build or the external toolchain rebuild. Publication CI is tracked separately from local validation.
Detailed scope and contracts
Runtime consumer dependency alignment — 15 September 2026
The product catalog, product VM acceptance and guest build remain pending.
Dependencies identify required contracts and closure gates; preparatory inventory/design can proceed in parallel under one owner per edited file. Link bounded implementation issues and their PRs here before claiming acceptance.
Close criteria only with their own reviewed deliverables and validation evidence.
Full catalog equality and actual consumer-image validation remain required under Integration regression 68. This dependency checkpoint does not close full lifecycle, frame or self-hosting acceptance.
Full service CPU/profiler VM acceptance and guest builds remain open in Phase 6 completion.
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.
Original ELF TLS image and linking source — 11 October 2026
Static native TLS refusal remains intact.
Complete caller-image preflight precedes every byte effect; refusal and spare bytes remain unchanged. Scalar addresses, IDs and generations grant no native authority.
Ordinary graph planning refuses TLS, and the distinct patch type cannot enter existing eight-byte-only handoff consumers. Descriptor resolver addresses remain descriptive; actual register-preserving code and its native mapping must be authenticated separately. Missing weak TLS providers, static-linker annotations and complete actual imported-artifact coverage remain unfinished.
No allocation, ambient lookup, numeric address dereference, capability minting, FS setter or runtime policy widening is introduced. Twenty-one independent template/image/expression/graph controls cover malformed/overflow/alignment/refusal, independent images, provider identity, full descriptor targets and late-refusal/retry output custody.
Actual Loaderd/Dynlinkd/Procd/Kernel initial and additional TLS image production, LibCstd errno/TLS/descriptor accessors, ordinary creation/deployment, inherited FP state, member exit/join/detach, module mutation/unload/destructors and all required native/imported consumers remain unfinished. Existing executable/artifact TLS refusal stays until every thread is initialized. Both complete EriX guest build generations and external Rust/LLVM rebuilding inside EriX remain mandatory and unperformed.
Canonical completion is 21.88% weighted and 10.11% whole acceptance: 33/460 accepted parents, 505/978 completed sub-items under 168 decomposed parents. Two explicit template/image source sub-items are credited; complete TLS and native thread lifecycle requirements remain open.
Tracking: complete TLS, native thread acceptance, linker runtime, libc, thread consumers, phase completion.
Related records and contracts
[FEATURE] [P11] Load compatibility ELF, TLS, constructors and declared runtime modules safelyto [FEATURE] Load compatibility ELF, TLS, constructors and declared runtime modules safelyerikinkinen referenced this issue from erix/kernel2026-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
erikinkinen referenced this issue from erix/loaderd2026-10-04 15:16:49 +02:00
erikinkinen referenced this issue from erix/bootloader2026-10-11 22:30:51 +02:00
erikinkinen referenced this issue from erix/lib-dynlink2026-10-11 22:30:53 +02:00
erikinkinen referenced this issue from erix/lib-elf2026-10-11 22:30:54 +02:00
erikinkinen referenced this issue from erix/rootd2026-10-11 22:30:55 +02:00