Repository navigation
openvmm: refuse microVM file children whose names hold a colon or a backslash - #1936
Merged
Pedro Henrique Penna (ppenna) merged 4 commits intoNov 22, 2026
Merged
Conversation
OpenVMM's microVM virtio-fs server opens the host directory of an aggregate's file child as a strict volume whose root object is the file, at its name, and a strict volume refuses every path with `\` or `:`. Nothing checked the file's name when the child attached, so a file child whose host file's name had one, as in a timestamp or a digest on Linux, or a Windows path that names an alternate data stream, attached without an error, but every guest lookup of it failed with EINVAL, and so did a READDIRPLUS of the aggregate's root from the child on (#1614). Pin microsoft/openvmm afa0e9c20a7943d3ec556098d9272f4ee502bdd4, one commit on 5c82edac4, the head of microsoft/openvmm#5208, which stacks on microsoft/openvmm#5207 and feature/microvm/dev 32888344a: - virtiofs: refuse a microVM file child that its volume cannot name. Attaching an aggregate fails, at a cold boot or a restore, with an error that names the file, when a file child's name holds `\` or `:`, which the volume would refuse as a path. Directory shares and children, and a file in a directory whose name has a colon, are unchanged. Its test fails without the change on Windows and on Linux (nvx-kvm-test). No saved state, protocol, ABI, or format, and no version of any of them, changes. The protocol vectors and CPU profiles that nvx copies are unchanged. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
OpenVMM's microVM virtio-fs server refuses `\` and `:` in every path of a share, and a file child's volume reaches its file by the file's name, so a file child whose name has one attached but stayed unreachable: every guest lookup of it failed with EINVAL (#1614). The pinned OpenVMM now refuses such a child when it attaches the aggregate. Section 3.6.2 of the host filesystem design says so, beside the VMM's refusal of a host path of the other kind. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The planner exports a mapped file outside the mapped directories as a file child of OpenVMM's aggregate, which reaches the file by its name. OpenVMM refuses a colon or a backslash in every path of a share, so a file child whose name has one, as on Windows a path that names an alternate data stream, could never be reached: the guest's bind of the child failed with EINVAL, and the pinned OpenVMM now refuses the child when the VM starts (#1614). The planner, which refuses what OpenVMM would refuse, so that such a policy fails when it is planned rather than at every start, accepted it, and so did ExportPlan::check, through which the CLI reads back the plan that a managed sandbox recorded. limits::file_name_problem now explains why OpenVMM cannot export such a file. plan refuses each child that exports one, and ExportPlan::check each file child of a plan, with an error of kind Unsupported that names the file. A file in a directory whose name has a colon is still exported, since OpenVMM opens a child's directory by its host path. files_named_with_colons_or_backslashes_are_not_exported_alone plans files named `colon:here.txt` and `back\slash.txt` on Linux, and the alternate data stream `config.json:stream` on Windows, which the planner refuses; checks a recorded plan whose file child has such a name, which the check refuses; and, on Linux, plans a file in the directory `colon:dir`, which the planner exports. Without the planner's refusal, the planner exports the stream on Windows, and without the check's, the recorded plan passes; with both, the test and the module's other tests pass on Windows and on Linux (Azure Linux 3.0, nvx-kvm-test). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Map position 343, the commit of microsoft/openvmm#5209, which NVX now pins at afa0e9c20, 217 commits past the mapped tip: - 343, virtiofs: refuse a microVM file child that its volume cannot name. open_microvm_volume refuses the file of an aggregate's file child whose name holds `\` or `:`, which the strict volume that it opens on the file's directory refuses in every path, so attaching the aggregate fails with an error that names the file. Such a child attached, but every guest LOOKUP of it failed with EINVAL. Position 343 is not yet assigned to a PR. It fixes a defect of position 165, which adds file children and which no PR maps, using the strict path check of PR18's position 081, and changes open_microvm_volume, which position 164 adds and position 165 extends to files; it changes nothing else that a mapped PR adds. Upstream main, bf353460f, lacks the defect, since it lacks the microVM profile, and replaying the commit there conflicts in all three files that it changes, which upstream main lacks, so it cannot go upstream on its own and follows position 165. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
5 tasks done
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are identified for the filesystem export filename-validation change.
No open issues 🎉
What changed in this PR
This PR addresses #1614 by aligning NVX’s filesystem export validation with OpenVMM’s rejection of standalone file children whose names contain a colon or backslash. It rejects these unreachable exports before boot, including those in previously recorded plans.
Changes:
- Pins the OpenVMM fix that rejects unsupported file-child names at attachment.
- Adds shared filename validation to export planning and recorded-plan checks, with regression coverage.
- Documents the restriction and maps the OpenVMM commit in the upstream roadmap.
| File | Description |
|---|---|
nvx/src/host/filesystem/verify.rs |
Rejects unsupported file-child names in recorded export plans. |
nvx/src/host/filesystem/tests.rs |
Tests planner and recorded-plan rejection, plus valid filenames under colon-containing directories. |
nvx/src/host/filesystem/mod.rs |
Rejects unsupported standalone file exports during planning. |
nvx/src/host/filesystem/limits.rs |
Adds the shared filename validation helper. |
doc/run.md |
Explains the restriction and rejection before boot. |
doc/openvmm-upstream-roadmap.md |
Records the new pin and maps its fix at position 343. |
doc/design/3.6-host-filesystem.md |
Documents OpenVMM’s file-child attachment restriction. |
Review effort: Balanced
Pedro Henrique Penna (ppenna)
deleted the
agents/issue-1614-aggregate-child-names
branch
November 22, 2026 03:52
This was referenced Nov 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1614
What does this pull request change?
It pins microsoft/openvmm#5209, which makes OpenVMM refuse a microVM aggregate's file child whose host file's name holds a backslash or a colon, and it makes NVX's export planner refuse such a file child before boot:
\and:in every path. Nothing checked the file's name when the child attached, so a file child whose name had one, as in a timestamp, a device identifier, or a digest on Linux, or a Windows path that names an alternate data stream (settings.json:stream,settings.json::$DATA), attached without an error, but the guest could never reach it: everyLOOKUPof it failed withEINVAL, and so did aREADDIRPLUSof the aggregate's root from the child on, while a plainREADDIRlisted it as a regular file. NVX's planner, which exports a mapped file outside the mapped directories as such a child, accepted it, sonvx runor a sandbox'sstartbooted a guest whose bind of the child then failed.microVM virtio-fs file <path> has a name with `\` or `:`, which no microVM path may contain. NVX's planner refuses such a file child when it plans the export, with anUnsupportederror that names the file, andExportPlan::checkrefuses a recorded plan that exports one, such as that of a sandbox provisioned before this change, beforestartlaunches OpenVMM. A directory's own name is never a path of its volume, so directory shares and children are unchanged, as is a file in a directory whose name has a colon.Commits:
openvmm: pin the refusal of microVM file children that it cannot namemoves the gitlink only, from5c82edac4toafa0e9c20. The protocol vectors and CPU profiles thatnvxcopies are unchanged.doc: say that the VMM refuses a file child with a backslash or colonadds the refusal to section 3.6.2 of 3.6 Host Filesystem.filesystem: refuse a file child whose name has a colon or a backslashaddslimits::file_name_problem, whichplanapplies to each child that exports a file andExportPlan::checkto each file child of a plan, a test, and a sentence to virtio-fs host mapping.doc: map the refusal of microVM file children in the OpenVMM roadmapmaps position 343, which is not yet assigned to a PR.Start with
open_microvm_volumein microsoft/openvmm#5209'svm/devices/virtio/virtiofs/src/microvm/fs.rs, thenfile_name_probleminnvx/src/host/filesystem/limits.rsand its callers inmod.rsandverify.rs.Left out, and found while fixing this:
EINVAL, since OpenVMM refuses such a name in every path of a share.EINVALas a whole, rather than leaving the entry out; this is not verified by a test.Both concern names inside directory children and predate this change.
Why is this change needed?
A host program that shares a single file whose name holds a colon, common in timestamps, PCI or device identifiers, OCI digests, and systemd-style names, got a VM whose share was listed but unreachable, and on Windows a path that names an alternate data stream attached a child that no request could use. The root cause is microsoft/openvmm
d26ae8bd5, "microVM: export single host files as aggregate virtio-fs children", roadmap position 165, which added file children and the file branch ofopen_microvm_volumewithout applying to the file's name the strict path rule that PR18's position 081,4354bcc9e, applies to every name of a node, in its insert preflight, and that the confinement check and the microVM save and restore apply too.Kept from the issue's suggested fix: refusing the file at attachment, in
open_microvm_volume. Changed: the issue's patch checked the name's bytes for\and:itself, while the fix applies the volume's ownvalidate_relative_path, so the rule at attachment cannot drift from the one that every later request applies, and its regression tests are unit tests in the crate, including Windows' alternate data streams, rather than a new integration test.Alternatives rejected:
How was this change validated?
Checks and results:
cargo nextest run --profile agent -p virtiofs, OpenVMM at the pin, Windows 11nvx-kvm-test, Azure Linux 3.0 VMa_file_child_with_a_backslash_or_colon_in_its_name_is_refusedwith the fix reverted, at the pin's parent5c82edac4and atb51f9156c, Windows and Linuxfile:stream(Windows) and:(Linux) attach; atb51f9156c, the guest'sLOOKUPof such a child fails withEINVALon both hosts, and on Linux aREADDIRPLUSof the root stops before itcargo check,cargo clippy --all-targets,cargo doc --no-deps-p virtiofs, Windows and Linuxcargo xtask fmt --fix(OpenVMM)cargo test --locked --manifest-path nvx/Cargo.toml --no-default-features --test openvmm_vectors -- --ignoredcargo test --locked --manifest-path nvx/Cargo.toml --no-default-features --test openvmm_cpu_profiles -- --ignored.github/actions/check-nvx/action.ymlon Windows 11:cargo fmt --all --check, the sixcargo clippy ... -- -D warningsruns,cargo test --locked --all-features,cargo test --locked,cargo buildandcargo test --locked --lib --no-default-features,cargo doc --locked --no-deps --all-featureswithRUSTDOCFLAGS=-D warnings, the 1.89 MSRVcargo check, theaarch64-apple-darwincargo check, andpython scripts\public_api.pynvx-kvm-test:python3 scripts/nvx.py check-guest-binaries,build-guest-binaries, andtest-guest-binariesfiles_named_with_colons_or_backslashes_are_not_exported_alone, with the planner's refusal or the check's removed, Windowsconfig.json:stream, and the recorded plan passescheckhost::filesystemtests with both, Windows and Linux;cargo clippywith-D warningson Linuxpython scripts\openvmm_pin.py check-branch --topic --target origin/agents/issue-1613-snapshot-boundspython scripts\openvmm_pin.py check-roadmap --worktreepython scripts\check_markdown_links.py,python scripts\check_test_layout.pypython scripts\check_test_changes.py --base origin/agents/issue-1613-snapshot-boundspython scripts\nvx.py verifypython scripts\local_gates.py --base origin/agents/issue-1613-snapshot-bounds --only nvx-cli --runBackend, host OS, host type, and guest:
KVM on
nvx-kvm-test, an Azure Linux 3.0 virtual machine (kernel 6.18), with the Alpine guest and the default kernel. OpenVMM was built at the pin bypython3 scripts/nvx.py build-openvmm --backend kvm(provenanceafa0e9c20, clean). The other artifacts came from thev0.1.0-dev.3e98eff40820release, installed bynvx download --hypervisor kvm. The NVX revision wasf1625dbf, whose tree differs from this head only in the recorded-plan check ofExportPlan::checkand its test, which no scenario reaches.python3 scripts/nvx.py test-microvm --backend kvmpassed forplatform-filesystem,filesystem-snapshot,filesystem-shares,filesystem-policy,denied-filesystem-paths,platform-aggregate-export, andfilesystem-comma-paths, which attach file children and directory children, capture and restore them, and share paths with commas.Left to CI, which passed for this head in run 44971224562: the rest of the microVM matrix on KVM, MSHV, and WHP, the guest builds, the benchmarks, and
openvmm-ci. OpenVMM's CI of the pin, run 44968497410, passed every job thatopenvmm-cirequires, aspython scripts\nvx.py check-openvmm-ci --revision afa0e9c20a7943d3ec556098d9272f4ee502bdd4confirms:unit tests [x64-linux],unit tests [x64-windows], andrun vmm-testsofx64-linux-amd-kvm,x64-linux-intel-mshv,x64-windows-intel, andx64-windows-amd; itsrun vmm-tests [x64-windows-amd-snp]failed, which NVX does not require.Checklist
python3 scripts/check_test_layout.pychecks.python3 scripts/check_test_changes.py --base origin/devlists no changeto an existing test, or a Changes to existing tests section below
explains each one.
.github/copilot-instructions.mdand the skills when a convention orworkflow changes.
nvxupdatesnvx-rs/public-api/withpython3 scripts/public_api.py --update.description says how the change versions or migrates them.
No version is created or bumped: no saved-state schema, ABI, machine-contract, time-ABI, manifest, or protocol version changes, and neither the device's saved state nor the recorded export plan changes. A restore of a snapshot whose aggregate exports such a file now fails when it attaches the aggregate, as a cold boot does; the child was never reachable. The public API of
nvxkeeps its items;ExportPlan::checknow also refuses a plan that exports such a file.OpenVMM pin
afa0e9c20a7943d3ec556098d9272f4ee502bdd4, pinned exactly; one commit, signed. It changes no existing test.5c82edac4; openvmm: pin the names that virtio-fs keeps through a rename onto itself #1926 (openvmm: virtiofs: renaming a path onto itself drops all tracked aliases at or below that path #1610) and openvmm: pin the bound of aggregate root directory reads #1930 (openvmm: virtiofs: aggregate synthetic root readdir performs unbounded infallible Vec::with_capacity(size) allocation #1598) have merged. [DO NOT REVIEW] virtiofs: keep node names when renaming a name onto itself openvmm#5206, [DO NOT REVIEW] virtiofs: bound the buffer of an aggregate root's directory read openvmm#5207, and [DO NOT REVIEW] virtiofs: bound microVM directory snapshots in total when listing openvmm#5208 have landed, sofeature/microvm/devis at5c82edac4, and [DO NOT REVIEW] virtiofs: refuse a microVM file child that its volume cannot name openvmm#5209's single commit follows it.feature/microvm/devfrom5c82edac4toafa0e9c20, whichpython scripts\openvmm_pin.py land afa0e9c20a7943d3ec556098d9272f4ee502bdd4 --remote originfinds as a fast-forward, not with the merge button, which squashes; then this pull request merges.