Repository navigation
host: expose the verified VM transport - #1406
Pedro Henrique Penna (ppenna) merged 7 commits into
Conversation
This pull request changes existing testsIt modifies or removes 17 existing test asset(s), listed below. Review each with care: a change to a test can hide a regression that the test caught. See doc/contribute.md#changes-to-existing-tests. Test code
Relocated unchanged: 0; added: 31. Compared the merge base |
There was a problem hiding this comment.
🟡 Changes recommended
A critical PID-reuse flaw in Linux peer verification can let an unrelated holder of a transferred Unix listener receive the launch capability.
1 open issue
What changed in this PR
This PR adds host::transport as the canonical host transport API, combining VM endpoint verification with the existing blocking NVXS driver. It builds on the activation changes in #1346 and retains legacy import paths and session wrappers.
Changes:
- Verify the recorded process and endpoint ownership before sending authentication capabilities.
- Return crate-level errors while retaining original causes and adapting dependent callers.
- Add connector coverage and update session tests, documentation, and public API snapshots.
| File | Description |
|---|---|
tests/runtime-adapter/tests/host_session.rs |
Adapt session assertions to crate errors and retained causes. |
tests/runtime-adapter/src/host/executions.rs |
Handle timeouts through ErrorKind. |
tests/runtime-adapter/src/host.rs |
Use canonical transport imports and error handling. |
tests/runtime-adapter/src/bin/runtime-adapter-host.rs |
Update unanswered-request timeout classification. |
nvx-rs/tests/nvxs/host.rs |
Adapt NVXS tests and cover original error causes. |
nvx-rs/src/host/transport/tests.rs |
Add endpoint ownership, process-exit, deadline, and I/O coverage. |
nvx-rs/src/host/transport.rs |
Introduce verified connections and relocate the NVXS driver. |
nvx-rs/src/host/session/tests.rs |
Test legacy process-query error translation. |
nvx-rs/src/host/session.rs |
Delegate connections and translate transport errors. |
nvx-rs/src/host/platform/windows/tests.rs |
Re-export pipe fixtures for transport tests. |
nvx-rs/src/host/platform/windows/endpoint/tests.rs |
Extract reusable pipe server fixtures. |
nvx-rs/src/host/platform/windows/endpoint.rs |
Expose the endpoint test module within the crate. |
nvx-rs/src/host/platform/tests.rs |
Make Windows fixtures available to sibling tests. |
nvx-rs/src/host/nvxs.rs |
Retain compatibility re-exports. |
nvx-rs/src/host/mod.rs |
Export and document the transport module. |
nvx-rs/README.md |
Describe transport verification and error semantics. |
nvx-rs/public-api/windows.txt |
Record the Windows transport API. |
nvx-rs/public-api/linux.txt |
Record the Linux transport API. |
Review effort: Balanced
f0ac213 to
7fe700f
Compare
Reuse the socket peer pidfd check before returning a control transport so a transferred listener cannot authenticate an exited creator's reused PID. Reject unsupported or denied peer verification without a numeric-PID fallback. Cover transferred listeners and denied SO_PEERPIDFD queries with Linux regressions that verify their subprocesses actually ran. Document that all Linux host control sessions now require Linux 6.5 or a backport; the guest kernel and OpenVMM pin are unchanged. Refs #1406 (comment) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: ebc0c25b-c373-4a83-8598-86152db0cce1
634fa88 to
74ca424
Compare
There was a problem hiding this comment.
🔵 Needs a closer look
The Linux authentication-boundary change depends on SO_PEERPIDFD semantics and needs exact-head endpoint-ownership and stale-listener/denial regressions plus Linux/Windows runtime qualification, which historical runs do not establish.
Review effort: Balanced
7fe700f to
2b5b44f
Compare
Expose the single existing timed transport through the host transport module. Verify endpoint servers against the recorded and held VM process before authentication, and retain NVXS connection behavior while preserving causes in the crate error. Keep compatibility paths and update affected control-session and runtime-adapter callers. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 988ad39e-5a8f-4e76-80b8-ccbe7f1f3c58
Keep process-query permission failures as I/O errors instead of endpoint refusals. Cover verified process exit while waiting for an endpoint and preserve the source of the legacy failure. Document the internal helpers required by the repository lint. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 988ad39e-5a8f-4e76-80b8-ccbe7f1f3c58
Record the host transport entry point, verified connector and retained NVXS connection on Linux and Windows. The existing platform transport and compatibility paths remain available; no unrelated public surface changes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 988ad39e-5a8f-4e76-80b8-ccbe7f1f3c58
Correct the NVXC layering description and the runtime adapter client module path after moving the retained host driver. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 988ad39e-5a8f-4e76-80b8-ccbe7f1f3c58
Remove the redundant ErrorKind import exposed by the host-only adapter build, retaining the existing grouped crate import. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 988ad39e-5a8f-4e76-80b8-ccbe7f1f3c58
Reuse the socket peer pidfd check before returning a control transport so a transferred listener cannot authenticate an exited creator's reused PID. Reject unsupported or denied peer verification without a numeric-PID fallback. Cover transferred listeners and denied SO_PEERPIDFD queries with Linux regressions that verify their subprocesses actually ran. Document that all Linux host control sessions now require Linux 6.5 or a backport; the guest kernel and OpenVMM pin are unchanged. Refs #1406 (comment) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: ebc0c25b-c373-4a83-8598-86152db0cce1
74ca424 to
7654ec4
Compare
There was a problem hiding this comment.
🟡 Changes recommended
The CLI retries and discards permanent SO_PEERPIDFD verification failures, producing a misleading endpoint-unavailable error instead of preserving the diagnostic.
1 open issue
1 resolved since last review
Review effort: Balanced
Return permanent SO_PEERPIDFD verification failures immediately from the CLI session connector, retaining the existing I/O diagnostic. Keep the retry behavior for unavailable endpoints and Windows named pipes. Add unavailable and denied peer-pidfd subprocess regressions that verify the diagnostic is retained without polling or retrying. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: ebc0c25b-c373-4a83-8598-86152db0cce1
There was a problem hiding this comment.
🔵 Needs a closer look
Mandatory SO_PEERPIDFD authentication changes the security boundary for every Linux control session, while exact-head Linux and Windows runtime qualification remains pending and requires maintainer confirmation beyond static review.
Review effort: Balanced
81f5875
into
feature/nvx-refactor
Reuse the socket peer pidfd check before returning a control transport so a transferred listener cannot authenticate an exited creator's reused PID. Reject unsupported or denied peer verification without a numeric-PID fallback. Cover transferred listeners and denied SO_PEERPIDFD queries with Linux regressions that verify their subprocesses actually ran. Document that all Linux host control sessions now require Linux 6.5 or a backport; the guest kernel and OpenVMM pin are unchanged. Refs #1406 (comment) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: ebc0c25b-c373-4a83-8598-86152db0cce1
Reuse the socket peer pidfd check before returning a control transport so a transferred listener cannot authenticate an exited creator's reused PID. Reject unsupported or denied peer verification without a numeric-PID fallback. Cover transferred listeners and denied SO_PEERPIDFD queries with Linux regressions that verify their subprocesses actually ran. Document that all Linux host control sessions now require Linux 6.5 or a backport; the guest kernel and OpenVMM pin are unchanged. Refs #1406 (comment) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: ebc0c25b-c373-4a83-8598-86152db0cce1


Base ref:
esaurez/slim-2.4.2-sl7.3-20261107at2b5b44fc38e3893de9e92d6f60caaabe67386101.Expose the existing host transport through
host::transport, verify that a VM endpoint belongs to the recorded and held process before authentication, and retain the blocking NVXS driver and compatibility paths. Process liveness checks, timed reads/writes, deadlines, unread accounting, handle duplication, partial receive recovery, terminal errors, and original causes remain intact.Linux peer verification and CLI diagnostics
The sixth commit, 7654ec4, addresses the stale Unix-listener PID-reuse finding. After matching the numeric peer PID, the control connector uses the existing original-peer
SO_PEERPIDFDcheck before returning a transport or sending a launch capability. Exited/reaped peers and unavailable or denied verification fail closed, without a numeric-PID fallback.The seventh commit, 81f5875, addresses the follow-up CLI finding. Linux
Unsupportedverification failures now return immediately through the existing CLI I/O error path, retaining theSO_PEERPIDFDdiagnostic instead of becoming an endpoint-unavailable timeout. Missing endpoints continue to retry, and Windows retry behavior is unchanged.This newly requires
SO_PEERPIDFDfor all production Linux host control sessions: CLI, Instance, legacy sessions, and the independent adapter. Linux 6.5 or a backport is required. Previously the strict check was used by the experimental restore path, not all production control sessions. The host-only requirement was explicitly accepted. No guest kernel configuration, guest rebuild, Windows transport change, or OpenVMM pin update is introduced.Complete owned slice and rebase-and-merge
All five original qualified SL2.11a commits remain in order, followed by the peer-verification and CLI-diagnostic fixes. These seven linear owned commits only are based directly on the current parent: no inherited old-parent history, merge commits, dropped/skipped original commits, or squashing. The first six published patches and messages remain unchanged by the seventh commit.
Actual GitHub REST reports
rebaseable=truefor the complete live tuple (81f58751f77787bc3fc9e6abfe4a3cfe12696be1,esaurez/slim-2.4.2-sl7.3-20261107,2b5b44fc38e3893de9e92d6f60caaabe67386101), with exactly seven owned commits and no merge commits. This is structural eligibility, not formal review approval, complete qualification, or permission to merge. Any ancestor merge, ref move, or automatic retarget invalidates that observation and requires a fresh tuple check.Canonical whole-owned scope is 369 CORE / 6 counted production paths / 22 raw paths, measured from the complete current parent to this frozen head with the existing
measure_pr.pyrules. The separate conservative both-side accounting is at most 377 CORE; neither correction is baseline-washed. The original 500 CORE ceiling is retained; the necessary sixth production owner,nvx-rs/src/host/cli/session.rs, is covered by the explicitly approved issue-scoped review-fix growth. CLI code is not discounted. All 306 original transport CORE remains charged. The three production adapter callers undertests/runtime-adapter/src/retain their disclosed pathname classification; they are not tests and have not been moved or manually discounted.TransportandTransportHandlestill re-export the single lower-platform definitions. The native pin remains14dc4116ec7e57567633c4b7b07892aca3a58522.Test changes
nvx-rs/src/host/platform/tests.rsandplatform/windows/tests.rs: expose existing owned pipe/server fixtures to transport tests.nvx-rs/src/host/platform/windows/endpoint/tests.rs: retain endpoint ownership and server lifetime fixtures.nvx-rs/src/host/session/tests.rs: cover legacy error translation and retain indeterminate process-query causes.nvx-rs/src/host/transport/tests.rs: retain the original connector, deadline, process-exit, endpoint-ownership, and error-cause coverage.nvx-rs/tests/nvxs/host.rsandtests/runtime-adapter/tests/host_session.rs: adapt existing session assertions to the canonical transport and preserved crate errors.nvx-rs/src/host/platform/linux/tests.rs: add transferred-listener/exited-creator and denied/unavailable peer-pidfd regressions (ENOPROTOOPT,EPERM,EINVAL), with subprocess completion markers.nvx-rs/src/host/cli/session/tests.rs: add a subprocess regression forENOPROTOOPT,EPERM, andEACCESthat verifies the retained diagnostic and zero retry/exit polls. Existing endpoint-unavailable timeout and process-exit tests are unchanged. Child completion markers reject zero-test false greens.nvx-rs/public-api/linux.txtandwindows.txt: retain the original qualified transport API snapshots; these fixes add no public signature.src/bin/runtime-adapter-host.rs,src/host.rs, andsrc/host/executions.rsupdate dependent callers, not test coverage.The
tests-modifiedlabel is intentional.Validation
Current published head:
81f58751f77787bc3fc9e6abfe4a3cfe12696be1.rebaseable=true; this remains time-bound to the actual head/base-ref/base-SHA tuple and is not merge permission.5822764019is COMMENTED, "Needs a closer look", not formally APPROVED. Both actionable review threads have actual published-fix replies and are resolved.42579436445, attempt 1, completed with FAILURE under an explicitly accepted temporary GitHub-download infrastructure exception. Its Windows OpenVMM setup exhausted three attempts to download the unchanged zstd1.5.7 archive with HTTP504 before any native compilation. The required-check failure is downstream of that failure. The other 25 executed jobs succeeded; 15 jobs were skipped. This is not an all-green CI result, and no rerun or substitute commit was created.7654ec4e...,74ca4245..., and634fa887...passed their own CI runs but do not qualify this head. All ignored cases and raw failures are retained. The unchanged199.1178ms/200ms timing failure and the corrected uninstalled1.89.0runner alias remain historical facts, not weakened assertions or tool-version changes.Historical qualification belongs to original source
48e6d91a..., not this head. Its completed software/runtime evidence includes actual CPU-profile/vector comparisons and the required managed-exec-config, sandbox-lifecycle, sandbox-proxy-only, and sandbox-ram-upper scenarios. Earlier comparison and scenario omissions were subsequently completed by real executions.Retained historical failures/caveats include delimiter/doc-lint/dependency failures, CRLF runner issues, MSVC-descendant cleanup and Windows interruption/child.pid diagnostics, the compiler-found duplicate
ErrorKindimport missed by an earlier static review, the Ubuntu 64-case setup block, an unbudgeted Cargo attempt, offline serde/cache failures, storage-floor refusals, and the unavailable native-alternate warning. Raw failures, skips, and recoveries are preserved.