[BUG] Preserve scope cleanup identity through native Close disposal #10

Closed
opened 2026-09-29 22:31:20 +02:00 by erikinkinen · 0 comments
Owner

Summary

Implemented in the coordinated signed VFS and Launchd correction. Original cleanup identity now survives provider closure through native delivery and receiver disposal; correlated pending disposal retains Launchd custody for later turns. Eight regression controls are authored and unrun.

Historical source-observed defect:

Acquisition-scope Close clears its original private cleanup key after provider retirement, before a retained native Close delivery finishes receiver disposal. A private cleanup query can therefore acknowledge an absent key while that original receiver still has a counted disposal obligation. The native delivery row remains retained and ordinary scope operations are already disabled; this report concerns premature cleanup acknowledgment, not a demonstrated access bypass.

Reproduction

Source-derived, unexecuted sequence: admit an owned exact-endpoint Close on a live acquisition scope. The first serving turn invokes close_exact_object, retires its provider owners, clears the scope key and removes descriptive metadata. Native completion and receiver DROP occur in a subsequent finish_exact_invocation turn. Query private retirement using the original scope key during this interval, or while receiver disposal is still pending. scope_index sees no scope owner and retire_acquisition_scope returns OK immediately.

This sequence has been identified by source inspection only. No test, image or CI execution has been performed, and an observed runtime failure is not claimed.

Expected and actual behavior

Expected: original-key cleanup must retain and account for receiver/native-delivery obligations until they are positively settled. Provider Close alone cannot establish complete scope cleanup. The counted key, original delivery and receiver must survive delayed or failed completion without admitting new use or permitting row reuse.

Actual in source: the delivery remains counted, but its original scope key is cleared before the native disposal barrier. Private key absence is then treated as complete cleanup. Preserve original key correlation through native completion and receiver disposal, including failure and concurrent authorized cleanup paths.

Environment and identity

  • Component: Vfsd revision 764a6a762465caf3d8e5abce24402720e2192ae4 on feature/posix-compat.
  • Integration source graph: 590c5e77587765af76f1e7c9fd039330a3dcb9ec.
  • Input: owned exact-endpoint Close followed by authorized original-key private scope cleanup.
  • Image, hardware/VM and toolchain: not exercised; execution is deferred by instruction.
  • Last known working revision: not established; the key-lifetime path was introduced with native scope preparation.

Evidence and prior checks

The scope Close lifetime defect is corrected and closed: vfsd e10522c0, launchd 2690e09e, integration 4f2aff8e, docs d963ebc5.

VFS retains the original private cleanup key after provider Close and descriptive metadata removal. The counted owner prevents row reuse through delayed delivery retirement and failed receiver disposal. Ordinary owned Close attempts its original completion at most once and keeps the key until native custody and receiver disposal settle. Legacy Close preserves its reply and disposal boundary as well.

Private revocation can supersede a pending Close reply. It suppresses that reply, invalidates the receiver and returns fully correlated BUSY while original delivery remains counted; subsequent exact turns relinquish that original owner. Launchd retains its cleanup obligation and retries on later scheduler turns. BUSY no longer poisons retirement, while wrong keys, generations, request correlations and contradictory result layers remain errors. No provider effect or native completion is replayed.

Five VFS and three Launchd regression controls are authored and unrun. They cover delayed native drain, positive completion followed by failed receiver disposal, private revocation during Close or an ordinary pending reply, stale cleanup after row reuse, and complete pending-result correlation. Existing native controls share the same independent fixture. Rustfmt was applied; component contracts and maintained manual TeX are updated.

Full realm open/openat, complete path/permission mediation, parent/symlink/mount transitions, conditional creation/append, descriptor publication/serving and native workloads remain unfinished. Both EriX guest-build generations and the external Rust/LLVM guest rebuild remain required. No runtime checklist acceptance is added: 16.91% weighted, 21/460 parents and 441/902 sub-items. Tests, builds, lint checks, documentation generation, VM/profiler execution and CI observation remain deferred; no execution pass is claimed.

Earlier evidence (historical; superseded where the current checkpoint above advances it):

Native scoped component dispatch is implemented and published: lib-ipc c0d3bec1, vfsd 764a6a76, integration 590c5e77, docs df1fb3c2.

Actual acquisition endpoints now select original root, cwd or counted candidates for permission evidence, complete ACL pages, conditional no-follow pinning and original-key retirement. Root and cwd descendants retain distinct original provider branches; no request supplies provider handles, mounts or replacement routes. The consumer retains its candidate key before submission. VFS counts the original owner and reserves both provider correlations before effects, fences replay across the complete nonzero key domain and preserves unknown outcomes for cleanup.

Native write ceilings precede permission observation. Every ACL page retains full target/object/revision/ordinal correlation and forwards its entries in place. Cleanup uses the original pre-reserved correlation without needing a returned handle. Private whole-scope revocation disables new use and attempts every child before disposing either anchor, so consumer loss cannot strand independently owned candidates. Public Close refuses live children; native delivery and receiver custody still settle independently.

Five shared-wire and seven actual VFS dispatch/state controls are authored and unrun. They cover literal framing, raw names, scope/branch isolation, lost replies, uncertain cleanup, exhaustion, ACL pages and whole-scope revocation. Existing custody regressions remain; fixture-only acquisition helpers are removed from production builds. Refused owner insertion leaves incoming custody with its original caller. Native adapter code is split by responsibility. Rustfmt was applied and component contracts/manual TeX are updated.

A further source audit identified premature scope-cleanup acknowledgment during native Close. The original delivery remains counted, but its scope cleanup key is cleared before receiver disposal finishes. This non-security lifecycle report is open for implementation; no observed runtime failure or access bypass is claimed. Fixing that ordering is the next priority.

Full realm open/openat remains open. Posixd still needs complete retained path walking, parent/symlink/mount transitions, sealed credential mediation, conditional creation/append, final descriptor publication and ordinary fd serving. Native open/openat workloads and both full EriX guest-build generations plus the Rust/LLVM guest rebuild remain unfinished. This checkpoint adds no full-item acceptance: 16.91% weighted, 21/460 parents and 441/902 sub-items. Tests, builds, lint checks, documentation generation, VM/profiler execution and CI observation remain deferred; no execution pass or measured speedup is claimed.

Earlier evidence (historical; superseded where the current checkpoint above advances it):

Inspect src/exact_objects.rs (close_exact_object), src/exact_invocation/serving.rs (advance_exact_invocation and finish_exact_invocation), src/handles/scope.rs (scope_index) and src/acquisition_scope.rs (retire_acquisition_scope) at the component revision above. Provider custody and native delivery custody remain separate, but the original cleanup selector currently disappears between their barriers. Add explicit delayed-completion, receiver-disposal failure and private-cleanup controls while preserving the existing counted owner.

Tracking

Related Vfsd implementation PR, realm open/openat, and Phase 6 master issue.

## Summary Implemented in the coordinated signed VFS and Launchd correction. Original cleanup identity now survives provider closure through native delivery and receiver disposal; correlated pending disposal retains Launchd custody for later turns. Eight regression controls are authored and unrun. Historical source-observed defect: Acquisition-scope Close clears its original private cleanup key after provider retirement, before a retained native Close delivery finishes receiver disposal. A private cleanup query can therefore acknowledge an absent key while that original receiver still has a counted disposal obligation. The native delivery row remains retained and ordinary scope operations are already disabled; this report concerns premature cleanup acknowledgment, not a demonstrated access bypass. ## Reproduction Source-derived, unexecuted sequence: admit an owned exact-endpoint Close on a live acquisition scope. The first serving turn invokes `close_exact_object`, retires its provider owners, clears the scope key and removes descriptive metadata. Native completion and receiver DROP occur in a subsequent `finish_exact_invocation` turn. Query private retirement using the original scope key during this interval, or while receiver disposal is still pending. `scope_index` sees no scope owner and `retire_acquisition_scope` returns OK immediately. This sequence has been identified by source inspection only. No test, image or CI execution has been performed, and an observed runtime failure is not claimed. ## Expected and actual behavior Expected: original-key cleanup must retain and account for receiver/native-delivery obligations until they are positively settled. Provider Close alone cannot establish complete scope cleanup. The counted key, original delivery and receiver must survive delayed or failed completion without admitting new use or permitting row reuse. Actual in source: the delivery remains counted, but its original scope key is cleared before the native disposal barrier. Private key absence is then treated as complete cleanup. Preserve original key correlation through native completion and receiver disposal, including failure and concurrent authorized cleanup paths. ## Environment and identity - Component: Vfsd revision `764a6a762465caf3d8e5abce24402720e2192ae4` on `feature/posix-compat`. - Integration source graph: `590c5e77587765af76f1e7c9fd039330a3dcb9ec`. - Input: owned exact-endpoint Close followed by authorized original-key private scope cleanup. - Image, hardware/VM and toolchain: not exercised; execution is deferred by instruction. - Last known working revision: not established; the key-lifetime path was introduced with native scope preparation. ## Evidence and prior checks [The scope Close lifetime defect](https://git.erikinkinen.fi/erix/vfsd/issues/10) is corrected and closed: [vfsd `e10522c0`](https://git.erikinkinen.fi/erix/vfsd/commit/e10522c024a7e4afc5766524a2c24ab67f8d635c), [launchd `2690e09e`](https://git.erikinkinen.fi/erix/launchd/commit/2690e09e84d3a57d9efe1a5c132d53da9cd0f4a0), [integration `4f2aff8e`](https://git.erikinkinen.fi/erix/integration/commit/4f2aff8eca29314a6ad5db1d4502e8218ef061a5), [docs `d963ebc5`](https://git.erikinkinen.fi/erix/docs/commit/d963ebc500e0380953eb792a1e1f2d5c00f678f1). VFS retains the original private cleanup key after provider Close and descriptive metadata removal. The counted owner prevents row reuse through delayed delivery retirement and failed receiver disposal. Ordinary owned Close attempts its original completion at most once and keeps the key until native custody and receiver disposal settle. Legacy Close preserves its reply and disposal boundary as well. Private revocation can supersede a pending Close reply. It suppresses that reply, invalidates the receiver and returns fully correlated BUSY while original delivery remains counted; subsequent exact turns relinquish that original owner. Launchd retains its cleanup obligation and retries on later scheduler turns. BUSY no longer poisons retirement, while wrong keys, generations, request correlations and contradictory result layers remain errors. No provider effect or native completion is replayed. Five VFS and three Launchd regression controls are authored and unrun. They cover delayed native drain, positive completion followed by failed receiver disposal, private revocation during Close or an ordinary pending reply, stale cleanup after row reuse, and complete pending-result correlation. Existing native controls share the same independent fixture. Rustfmt was applied; component contracts and maintained manual TeX are updated. Full [realm open/openat](https://git.erikinkinen.fi/erix/posixd/issues/17), complete path/permission mediation, parent/symlink/mount transitions, conditional creation/append, descriptor publication/serving and native workloads remain unfinished. Both EriX guest-build generations and the external Rust/LLVM guest rebuild remain required. No runtime checklist acceptance is added: 16.91% weighted, 21/460 parents and 441/902 sub-items. Tests, builds, lint checks, documentation generation, VM/profiler execution and CI observation remain deferred; no execution pass is claimed. Earlier evidence (historical; superseded where the current checkpoint above advances it): Native scoped component dispatch is implemented and published: [lib-ipc `c0d3bec1`](https://git.erikinkinen.fi/erix/lib-ipc/commit/c0d3bec14920b4a20693daa159041c0a6e7a3b20), [vfsd `764a6a76`](https://git.erikinkinen.fi/erix/vfsd/commit/764a6a762465caf3d8e5abce24402720e2192ae4), [integration `590c5e77`](https://git.erikinkinen.fi/erix/integration/commit/590c5e77587765af76f1e7c9fd039330a3dcb9ec), [docs `df1fb3c2`](https://git.erikinkinen.fi/erix/docs/commit/df1fb3c2981015c6a6d849639deda4bd779127a2). Actual acquisition endpoints now select original root, cwd or counted candidates for permission evidence, complete ACL pages, conditional no-follow pinning and original-key retirement. Root and cwd descendants retain distinct original provider branches; no request supplies provider handles, mounts or replacement routes. The consumer retains its candidate key before submission. VFS counts the original owner and reserves both provider correlations before effects, fences replay across the complete nonzero key domain and preserves unknown outcomes for cleanup. Native write ceilings precede permission observation. Every ACL page retains full target/object/revision/ordinal correlation and forwards its entries in place. Cleanup uses the original pre-reserved correlation without needing a returned handle. Private whole-scope revocation disables new use and attempts every child before disposing either anchor, so consumer loss cannot strand independently owned candidates. Public Close refuses live children; native delivery and receiver custody still settle independently. Five shared-wire and seven actual VFS dispatch/state controls are authored and unrun. They cover literal framing, raw names, scope/branch isolation, lost replies, uncertain cleanup, exhaustion, ACL pages and whole-scope revocation. Existing custody regressions remain; fixture-only acquisition helpers are removed from production builds. Refused owner insertion leaves incoming custody with its original caller. Native adapter code is split by responsibility. Rustfmt was applied and component contracts/manual TeX are updated. A further source audit identified [premature scope-cleanup acknowledgment during native Close](https://git.erikinkinen.fi/erix/vfsd/issues/10). The original delivery remains counted, but its scope cleanup key is cleared before receiver disposal finishes. This non-security lifecycle report is open for implementation; no observed runtime failure or access bypass is claimed. Fixing that ordering is the next priority. [Full realm open/openat](https://git.erikinkinen.fi/erix/posixd/issues/17) remains open. Posixd still needs complete retained path walking, parent/symlink/mount transitions, sealed credential mediation, conditional creation/append, final descriptor publication and ordinary fd serving. Native open/openat workloads and both full EriX guest-build generations plus the Rust/LLVM guest rebuild remain unfinished. This checkpoint adds no full-item acceptance: 16.91% weighted, 21/460 parents and 441/902 sub-items. Tests, builds, lint checks, documentation generation, VM/profiler execution and CI observation remain deferred; no execution pass or measured speedup is claimed. Earlier evidence (historical; superseded where the current checkpoint above advances it): Inspect `src/exact_objects.rs` (`close_exact_object`), `src/exact_invocation/serving.rs` (`advance_exact_invocation` and `finish_exact_invocation`), `src/handles/scope.rs` (`scope_index`) and `src/acquisition_scope.rs` (`retire_acquisition_scope`) at the component revision above. Provider custody and native delivery custody remain separate, but the original cleanup selector currently disappears between their barriers. Add explicit delayed-completion, receiver-disposal failure and private-cleanup controls while preserving the existing counted owner. ## Tracking Related [Vfsd implementation PR](https://git.erikinkinen.fi/erix/vfsd/pulls/3), [realm open/openat](https://git.erikinkinen.fi/erix/posixd/issues/17), and [Phase 6 master issue](https://git.erikinkinen.fi/erix/integration/issues/65).
erikinkinen added this to the Alpha 1 milestone 2026-10-30 09:35:17 +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/vfsd#10
No description provided.