Repository navigation
host: refuse caller overrides of rendered boot tokens - #1332
Pedro Henrique Penna (ppenna) merged 3 commits into
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The review identifies no active issues with the reserved boot-token protection and related API updates.
No open issues 🎉
What changed in this PR
This PR advances #1098 by preventing caller boot text from overriding configuration-rendered tokens, building on the cold-boot renderer introduced in #1312. Other caller-owned tokens remain accepted and unchanged.
Changes:
- Reject reserved root, view, mapping and
virtfs_*names using Linux and init token parsing, including dash/underscore equivalence. - Expose the configuration’s mapping table and existing mapping protocol module, and move
COMMAND_LINE_BUDGETinto configuration. - Add four tests and update documentation and both public-API snapshots.
| File | Description |
|---|---|
nvx-rs/src/protocol/mod.rs |
Makes the existing maps module public. |
nvx-rs/src/host/launch.rs |
Imports the relocated command-line budget. |
nvx-rs/src/host/config/tests.rs |
Tests token rejection, caller-text preservation, mapping projection and codec access. |
nvx-rs/src/host/config/mod.rs |
Adds reserved-token checks, mapping-table access and the relocated constant. |
nvx-rs/README.md |
Documents token ownership, mapping access and the budget location. |
nvx-rs/public-api/windows.txt |
Records the Windows public-API changes. |
nvx-rs/public-api/linux.txt |
Records the Linux public-API changes. |
Review effort: Balanced
7d4b7e8 to
43716c0
Compare
This pull request changes no existing testRelocated unchanged: 0; added: 4. Compared the merge base |
Check caller boot tokens with the existing kernel and init readers while leaving other guest tokens caller-owned. Expose the exact export mapping table and map codec, retaining the protocol-root re-exports, and move the kernel command-line budget into configuration. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 0aa8163c-8d27-4d54-be61-d9b23c1bc15c
Document the reserved boot-token names, unchanged caller-owned tokens, pure mapping table, public map codec and configuration command-line budget so the crate specification matches the configuration checks. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 0aa8163c-8d27-4d54-be61-d9b23c1bc15c
a967f69 to
82e1c0f
Compare
|
Copilot please review the current head |
Reviewed |
Co-authored-by: esaurez <22397041+esaurez@users.noreply.github.com>
aa6bb42
into
feature/nvx-refactor
Part of #1098
SL2.4b builds on the renderer landed by #1312 and prevents caller boot text from replacing configuration-rendered tokens while leaving every other token caller-owned.
VmConfig::checkandkernel_command_linerefuse the fixed root/view/mapping names and all normalizedvirtfs_*names. The existing Linux and init token readers cover their differing quoting, whitespace and--behavior; dash/underscore equivalence follows Linux parameter-name matching. Caller tokens such asnvx_entrypoint,nvx_argandnvx_shareremain accepted and unchanged.VmConfig::mapping_tablereturns exactlyExportPlan::guest_table, without host I/O or another validation pass. Its entries are those counted bynvx_maps; without an export the table is empty and that token is absent. The existingprotocol::mapsmodule becomes public, with the protocol-root re-exports and wire codec retained. Only the existingCOMMAND_LINE_BUDGETmoves fromhost::launchtohost::config. Both public-API snapshots and the configuration documentation describe these changes.This does not change OpenVMM argument rendering, the Windows process-command-line check, the mapping wire format, protocol versions, guest implementation or the native pin. Legacy launch checks remain.
Tests
The official comparison against the parent reports 0 modified or removed existing test items, 0 unchanged relocations and 4 added tests in
nvx-rs/src/host/config/tests.rs:caller_tokens_cannot_replace_rendered_tokens_under_kernel_name_matching: covers reserved names, every dash/underscore combination, both root forms, quoted/init-visible tokens, whitespace and tokens after--.caller_owned_guest_tokens_and_noncolliding_names_stay_unchanged: accepts representative guest-owned tokens and noncolliding names without rewriting their text.mapping_table_is_the_exact_export_projection_counted_by_the_boot_token: checks the exact ordered entries, writable/read-only and nested binds, their count, pure projection despite unrelated invalid configuration, and the no-export case.public_maps_codec_keeps_the_protocol_root_reexports_usable: uses the unchanged codec through both the public module and the retained root exports.The existing
host::launchtestsmappings_add_the_export_and_the_mapping_count,kernel_parameters_are_checkedandkernel_parameters_are_read_as_the_kernel_reads_themare retained unchanged. No existing assertion, timeout, fixture, test hook or CI wiring is weakened or removed.Size
40 core lines in 3 counted files, across 7 changed paths, measured for the complete
09a6f041..82e1c0f3range with the official size tool and its normal rules. Documentation/API snapshots and tests account for 78 and 172 added non-core lines respectively. No size exception is used.Validation
The original two-commit slice was rebased onto current #1312 (
43716c03). Configuration/API/documentation conflicts retained the parent's capture checking, public capture definitions and complete capture/restore documentation. Only three initializers in the added tests gained the requiredcapture: None; their assertions and the original production checks are unchanged.All commands below actually ran at
bef7e6bb, whose complete source tree is0cb8028b. While qualification ran, #1312 merged intofeature/nvx-refactorat09a6f041and GitHub retargeted this PR automatically. The landed input has exactly the same tree as43716c03; replaying only the two own commits onto it produced final82e1c0f3, with the same complete source tree as testedbef7e6bb. Source/native identity, executable digests and source-provenance bindings were checked separately. Results retain their actualbef7e6bbexecution identity: no unchanged matrix was repeated or relabelled as an82e1c0f3run. Historical7a87b03e/9e1c7081results are not qualification of this changed input.The complete applicable Rust action passed on Windows and Linux: formatting, all five warning-denied Clippy configurations, tests, protocol-only builds, strict rustdoc, public-API snapshots, the MSRV check, bundling, runtime-adapter configurations and native vector/profile comparisons. Linux also passed the macOS cross-check and the static guest-binary lint/build/test and ELF checks.
The configuration selection passed all 20 tests on each OS. Both complete CLI actions included all 22 action-defined modules, all eight root-token shell cases and the required cancellation shell case without skipping those cases; host-inventory tests and all command-help checks passed. Linux passed all 14 quality commands, including both typing platforms, shell linters, Markdown/test-layout checks, 25 Specula tests and six PowerShell syntax checks.
An initial complete Linux all-features run encountered
ETXTBSYwhile an unchanged CLI fixture executed its temporary binary copy. One repeat of the same complete command passed, without source, assertion, deadline, skip or test-threading changes; no specific descriptor holder or source fix is claimed. A separate Linux CLI transport prestart failed before any controller or command existed; that no-effect state was verified before its actual complete execution passed. Both complete unit actions took over 12 minutes and finished normally, without interruption or timeout changes. The original failures and observations remain retained.Independent read-only review of the exact final head has no open findings. Final size/test-change preflight was repeated against the actual landed base; test-layout and the other quality checks passed on the byte-identical tested tree.
Own VM runs are not applicable to this intermediate configuration-only change: it changes no guest code, VMM arguments, CLI VM path or API consumed by the runtime adapter. No new VMM/kernel build, KVM/WHP/MSHV runtime scenario or full-group distro evaluation is claimed here; applicable group/runtime coverage remains with the later changes and CI. This PR remains Draft; its CI jobs may be skipped, and no CI result is claimed.