Skip to content

openvmm: pin the resolution of microVM file child paths - #1953

Merged
Pedro Henrique Penna (ppenna) merged 2 commits into
devfrom
agents/issue-1618-aggregate-child-paths
Nov 22, 2026
Merged

Pedro Henrique Penna (ppenna) merged 2 commits into
devfrom
agents/issue-1618-aggregate-child-paths

Conversation

@ppenna

Copy link
Copy Markdown
Contributor

Fixes #1618

What does this pull request change?

It pins microsoft/openvmm#5219, which makes OpenVMM's virtio-fs device attach a microVM aggregate's file child through the file that the child's host path resolves to, the file whose identity the child has.

OpenVMM checks a file child's host path against the child's identity with MicroVmAggregateChild::validate_root_path, which, like microvm_file_identity, canonicalizes the path: it resolves the path from the current directory, and through symbolic links to their final target. open_microvm_volume, which opens the child's volume, then split the path as given: it opened the path's parent and exposed the path's last name. A bare file name, such as seed.txt, whose parent is the empty path, therefore failed to attach, with ENOENT on Linux or EINVAL on Windows, and so did a symbolic link to a regular file, with EACCES, since the volume exposed the link, which a file child refuses, although both passed the identity check.

Now open_microvm_volume resolves a symbolic link at the end of a file child's path to its final target, as the identity does, and makes any other path absolute, which keeps the name that the path gives, so that the volume opens the directory of the file that the identity names and reaches the file there by its name. The name check that #1614 added, which refuses a name with \ or :, applies to that name, which for a link is its target's. Directory shares and children are unchanged.

NVX resolves each host path to its canonical path before it passes it to OpenVMM's command line, which canonicalizes host paths again and refuses symbolic links in them, so nothing that NVX attaches changes, and no NVX documentation changes: the fix keeps the device's validation and its attachment consistent for the device's other callers.

No version is created or bumped: no ABI, machine-contract, time-ABI, snapshot, manifest, saved-state, schema, or protocol version changes, in NVX or in OpenVMM, and no saved-state field or on-disk format changes.

Commits:

  • openvmm: pin the resolution of microVM file child paths moves the gitlink from 3aefff9ba to de700ffc296303ebd76d79423c6ce1fd801d1dc5, the head of [DO NOT REVIEW] virtiofs: resolve a microVM file child's path as its identity does openvmm#5219, and changes nothing else. The protocol vectors and CPU profiles that nvx copies are unchanged.
  • doc: map the resolution of microVM file child paths in the OpenVMM roadmap maps the new chain position, 353, which is not yet assigned to a PR.

Start with open_microvm_volume in microsoft/openvmm#5219's vm/devices/virtio/virtiofs/src/microvm/fs.rs, then its tests in microvm/aggregate_fs_tests.rs: a_file_child_may_be_named_relative_to_the_current_directory, a_file_child_may_be_a_symbolic_link_to_its_file, and a_file_child_link_needs_a_target_that_its_volume_can_name.

Limitations that remain: no microVM scenario attaches a file child by a relative path or a link, since NVX and OpenVMM's command line pass canonical paths; the unit tests cover both. The two tests that create symbolic links are ignored on Windows, which needs permission to create native symbolic links, as an existing virtio-fs test is; they ran on the Windows host below with that permission.

Why is this change needed?

A caller of OpenVMM's virtio-fs device that computed a file child's identity from a bare file name or from a symbolic link to the file, and checked it with validate_root_path, got an unexpected ENOENT, EINVAL, or EACCES partway through VirtioFs::new_microvm_aggregate, for a path that the device had just accepted, while a directory share follows a symbolic link at its root.

The defect came with OpenVMM's d26ae8bd5, "microVM: export single host files as aggregate virtio-fs children" (roadmap position 165), whose open_microvm_volume split the path as given, while its identity functions canonicalize it.

Kept from the issue's suggested fix: a link resolves to its final target, as a directory share's root does, and a bare name opens the current directory. Changed:

Rejected: refusing links in microvm_file_identity, which would make a file child refuse what a directory child and the identity's documented resolution accept.

How was this change validated?

Checks and results:

  • OpenVMM, with Rust 1.97.1, cargo nextest run --profile agent -p virtiofs at the pin, and the new tests with the fix reverted:

    Host Without the fix With the fix, at the pin
    Windows 11, local, where native symbolic links can be created at 3aefff9ba, the pin's parent: a_file_child_may_be_named_relative_to_the_current_directory fails with failed to initialize filesystem volume: EINVAL, and a_file_child_may_be_a_symbolic_link_to_its_file with EACCES 205 pass, 3 skipped (the tests that need native symbolic links); 208 pass with --run-ignored all
    Azure Linux 3.0, virtual machine (nvx-kvm-test) at 28f2e5793, openvmm: virtiofs: microVM aggregate file child with ':' or '\' in host filename attaches successfully but fails every guest lookup with EINVAL #1614's change, before the stack's rebase: all three new tests fail, the bare name with ENOENT, the links with EACCES, and the link named link:target because of its own name 213 pass, 1 skipped (it needs CAP_SETUID), as at the base

    The pinned commit is the rebase of 87455693c, on which the Linux failures above were recorded, and git range-diff shows its patch unchanged.

  • At the pin, cargo check, cargo clippy --all-targets, and cargo doc --no-deps for virtiofs pass without warnings on Windows, and cargo clippy --all-targets on nvx-kvm-test; cargo xtask fmt --fix changes nothing.

  • python scripts/local_gates.py --base origin/agents/issue-1608-link-unlinked --only test-changes markdown-links test-layout openvmm-vectors openvmm-cpu-profiles --run on Windows: all five pass. python -m unittest scripts/test_openvmm_pin.py passes.

  • python scripts/openvmm_pin.py source de700ffc2 --pr 5219 reports a good signature and the pull request's head; check-branch --topic --target origin/agents/issue-1608-link-unlinked and check-roadmap --worktree pass; python scripts/check_markdown_links.py passes; python scripts/check_test_changes.py --base origin/agents/issue-1608-link-unlinked lists no change to an existing test.

  • python scripts/nvx.py check-openvmm-ci --revision de700ffc296303ebd76d79423c6ce1fd801d1dc5 passes: OpenVMM's CI of the pin, run 44987335572, passed unit tests [x64-linux], unit tests [x64-windows], and run vmm-tests of x64-linux-amd-kvm, x64-linux-intel-mshv, x64-windows-intel, and x64-windows-amd.

  • MicroVM checks on nvx-kvm-test, on KVM, with OpenVMM built from the pin by python3 scripts/nvx.py build-openvmm --backend kvm, whose provenance names de700ffc2 from a clean tree, and the guest artifacts of release v0.1.0-dev.b2a67fb3a53a, from nvx download --hypervisor kvm: the virtio-fs scenarios platform-filesystem, filesystem-snapshot, filesystem-shares, filesystem-policy, filesystem-owner, denied-filesystem-paths, platform-aggregate-export, and filesystem-comma-paths pass, in one python3 scripts/nvx.py test-microvm --backend kvm --scenario NAME ... run. filesystem-shares and platform-aggregate-export attach file children, cold and through a snapshot. They ran in a worktree of dev at a9001c2ab, whose scripts/ are this head's, with the pin's OpenVMM staged as its gitlink, since this head has no release within the 20 first-parent commits that download searches. filesystem-owner ran unprivileged, so OpenVMM could not assume other host identities, and it checked that guest root and foreign callers fail with EPERM.

Backend, host OS, host type, and guest: the unit tests ran on Windows 11 (local) and on Azure Linux 3.0 (nvx-kvm-test, a KVM virtual machine); the microVM checks ran on nvx-kvm-test, on KVM, with the Alpine guest.

Left to CI: the full NVX matrix, on KVM, MSHV, and WHP, for this head.

Checklist

  • Tests cover the new or fixed behavior, in the layout that
    python3 scripts/check_test_layout.py checks.
  • python3 scripts/check_test_changes.py --base origin/dev lists no change
    to an existing test, or a Changes to existing tests section below
    explains each one.
  • The documentation that the change affects is updated, including
    .github/copilot-instructions.md and the skills when a convention or
    workflow changes.
  • A change to the public API of nvx updates nvx-rs/public-api/ with
    python3 scripts/public_api.py --update.
  • Snapshots, protocols, and on-disk formats stay compatible, or the
    description says how the change versions or migrates them.

OpenVMM pin

A microVM aggregate's file child whose host path is a bare file name,
such as `seed.txt`, or a symbolic link to a regular file passed
OpenVMM's validation of the child's identity, which resolves the path
from the current directory and through symbolic links, but attaching
it failed (#1618): the child's volume opened the path's
empty parent, or exposed the link itself, which a file child refuses.

Pin microsoft/openvmm de700ffc296303ebd76d79423c6ce1fd801d1dc5, one
commit on 3aefff9ba, the head of microsoft/openvmm#5218:

- virtiofs: resolve a microVM file child's path as its identity does.
  open_microvm_volume resolves a symbolic link at the end of a file
  child's path to its final target, as the identity does, and makes
  any other path absolute, which keeps the name that the path gives,
  so the volume opens the directory of the file that the identity
  names, and the name check of #1614 applies to the name
  that the volume uses. Its tests fail without the change on Windows
  and on Linux (nvx-kvm-test).

NVX passes canonical host paths, and OpenVMM's command line refuses
links, so neither attaches differently: the fix serves the device's
other callers. 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>
…admap

Map position 353, the commit of microsoft/openvmm#5219, which NVX now
pins at de700ffc2, 227 commits past the mapped tip:

- 353, virtiofs: resolve a microVM file child's path as its identity
  does. open_microvm_volume opens the file that the host path of an
  aggregate's file child resolves to, as the child's identity does: it
  resolves a symbolic link at the path's end to its final target, and
  makes any other path absolute, which keeps the name that the path
  gives. A bare file name opened the path's empty parent, which
  failed, and a link exposed the link itself, which a file child
  refuses.

Position 353 is not yet assigned to a PR. It fixes a defect of
position 165, which no PR maps, and follows it, as position 343 does,
whose name check now applies to the name that the volume uses.
Replaying the commit on upstream main, bf353460f, conflicts in the
microVM's fs.rs and aggregate_fs_tests.rs, which upstream main lacks,
so it cannot go upstream on its own.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The cross-platform virtio-fs pin needs maintainer review because OpenVMM #5219 remains open without recorded reviews, and exact-pin provenance and prerequisite landing have not been independently verified.

No open issues 🎉

What changed in this PR

This PR pins OpenVMM’s fix for microVM file children supplied as bare relative paths or symbolic links, addressing #1618. The roadmap records the new revision and its place in the OpenVMM chain; NVX’s canonicalized attachment paths remain unchanged.

Changes:

  • Updates the documented pin to de700ffc2, chain position 353.
  • Updates the chain diagram, counts, and commit mapping.
  • Explains the path-resolution fix, its dependencies, and why it cannot land independently upstream.
File Description
doc/​openvmm-upstream-roadmap.md Records position 353 and documents the file-child path-resolution fix.

Review effort: Balanced

Base automatically changed from agents/issue-1608-link-unlinked to dev November 22, 2026 09:46
@ppenna
Pedro Henrique Penna (ppenna) added this pull request to the merge queue Nov 22, 2026
Merged via the queue into dev with commit 3639d85 Nov 22, 2026
89 of 91 checks passed
@ppenna
Pedro Henrique Penna (ppenna) deleted the agents/issue-1618-aggregate-child-paths branch November 22, 2026 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

openvmm: virtiofs: microVM aggregate file child accepts bare relative paths and symlinks in identity validation but fails in open_microvm_volume

2 participants