Repository navigation
openvmm: pin microVM aggregate restores that refuse the root's node ID - #2158
Merged
Pedro Henrique Penna (ppenna) merged 3 commits intoNov 26, 2026
Merged
Pedro Henrique Penna (ppenna) merged 3 commits into
Pedro Henrique Penna (ppenna) merged 3 commits into
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block the documentation updates for the aggregate-snapshot restore validation fix.
No open issues 🎉
What changed in this PR
This PR integrates the OpenVMM fix for #2134 into NVX, rejecting malformed aggregate snapshots whose next node ID would reuse the synthetic root’s reserved ID.
Changes:
- Records OpenVMM revision
5f4a47b83at roadmap position 398, including its dependencies and fix rationale. - Documents that restore requires the next node ID to exceed the root’s ID, without changing the saved-state format.
| File | Description |
|---|---|
doc/openvmm-upstream-roadmap.md |
Updates the pin, chain counts, and mapping for the aggregate-restore fix. |
doc/design/3.6-host-filesystem.md |
Clarifies the next-node-ID requirement during restore validation. |
Review effort: Balanced
Pedro Henrique Penna (ppenna)
force-pushed
the
agents/issue-2133-virtiofs-unreachable-entries
branch
from
November 25, 2026 19:40
c3f4c02 to
9f5bae7
Compare
A microVM aggregate's saved state whose node table was empty and whose next node ID was 1, FUSE_ROOT_ID, restored (#2134). Node 1 of an aggregate is its synthetic root, which has no saved node, so the next lookup of a child gave the child's root node 1, the device routed every request for that node to the synthetic root, and the device's next save could not restore. The device never saves such a state, so only a corrupt or crafted state reaches this. Pin microsoft/openvmm 5f4a47b83591ccbcc4f9a2563b5322603def625b, the head of microsoft/openvmm#5290, one commit on a79b4bb40, the head of microsoft/openvmm#5289, which NVX pins below this commit: - virtiofs: refuse a microVM aggregate state whose next node ID is 1. validate_microvm_state, which the device's saved-state validator and restore_microvm_state run before they change any state, requires the next node ID to exceed FUSE_ROOT_ID as well as every saved node ID, which changes nothing for a single share, whose root is its saved node 1. Its test fails without the fix, since the restore succeeds, and passes with it, on Windows and on Linux. At the pin, the tests of the virtiofs package pass on Windows and Linux, and NVX's filesystem-snapshot, platform-aggregate-export, and filesystem-shares microVM scenarios pass on KVM. No saved-state, protocol, or ABI 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>
…nVMM roadmap Map position 398, the commit of microsoft/openvmm#5290, which NVX now pins at 5f4a47b83, 272 commits past the mapped tip, on a79b4bb40, position 397, the head of microsoft/openvmm#5289: - 398, virtiofs: refuse a microVM aggregate state whose next node ID is 1. validate_microvm_state requires the next node ID to exceed FUSE_ROOT_ID as well as every saved node ID, so that a restore no longer accepts an aggregate state without nodes whose next node ID is that of the synthetic root, which has no saved node, and then gives the synthetic root's node to the first child that the guest looks up (#2134). Position 398 is not yet assigned to a PR: it fixes a defect of position 164, which no PR maps, since PR18's position 083's check of the next node ID held as long as every state saved its root as node 1, which position 164's aggregates do not, so it is not a PR18 fixup, unlike positions 389, 393, and 396. Of positions 372-397, only 390, 393, and 396 change its files, all three the microVM's state.rs's reopen_flags, and position 390 also the check of writable handles after the check that it changes. Upstream main, 8d4e03132, lacks the defect, since it lacks the microVM's saved state, and replaying the commit there conflicts in the microVM's state.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>
The host filesystem's description of a restore said that the device requires unique IDs below the next IDs, but not that the next node ID must also pass node 1, the root's. A single share saves its root as node 1, so its next node ID passed the root anyway, but an aggregate saves no node for its synthetic root, and OpenVMM accepted an aggregate state without nodes whose next node ID was 1, which gave the synthetic root's node to the first child that the guest looked up (#2134). The pinned OpenVMM refuses that state. Say that a restore requires a next node ID above the root's, even for an aggregate, which saves no node for its synthetic root. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Pedro Henrique Penna (ppenna)
force-pushed
the
agents/issue-2134-virtiofs-aggregate-next-node
branch
from
November 25, 2026 19:44
1428892 to
71c5f47
Compare
Base automatically changed from
agents/issue-2133-virtiofs-unreachable-entries
to
dev
November 26, 2026 02:43
Pedro Henrique Penna (ppenna)
deleted the
agents/issue-2134-virtiofs-aggregate-next-node
branch
November 26, 2026 03:23
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 #2134
Stacked on #2156 (
agents/issue-2133-virtiofs-unreachable-entries), itself stacked on #2155 and the pull requests below it; only the top three commits belong to this pull request (see OpenVMM pin for the landing order).What does this pull request change?
A microVM restore now refuses an aggregate's saved state whose next node ID is 1, the node of the aggregate's synthetic root. Before, a state whose node table was empty and whose next node ID was 1 restored, and the restored device then gave node 1 to the first child that the guest looked up: the device routed every request for that node to the synthetic root, so the guest's listing of the child showed the aggregate's children instead of the child's files, and the device's next save failed to restore with "saved aggregate inode table contains the synthetic root". The device never saves such a state, since an aggregate numbers its nodes from 2, so only a corrupt or crafted snapshot reaches this; every state that the device saves still restores.
The fix is in OpenVMM, microsoft/openvmm#5290, which this pull request pins:
virtiofs: refuse a microVM aggregate state whose next node ID is 1.validate_microvm_state(vm/devices/virtio/virtiofs/src/microvm/state.rs), which the device's saved-state validator andrestore_microvm_staterun before they change any state, requires the next node ID to exceedFUSE_ROOT_IDas well as every saved node ID. One test inmicrovm/aggregate_fs_tests.rs.The NVX commits are the gitlink-only pin; the mapping of the commit, position 398, in the OpenVMM roadmap; and step 2 of Restore, which now says that the device requires a next node ID above the root's, even for an aggregate, which saves no node for its synthetic root. Start with the OpenVMM diff:
git diff --submodule=diff origin/agents/issue-2133-virtiofs-unreachable-entries...HEAD.Left out and limitations:
Why is this change needed?
A restore must refuse a state that would break the device's invariants rather than restore a device that misroutes the guest's requests and saves a state that no restore accepts. Node 1 is the root of every attachment, and an aggregate's synthetic root holds it without a saved node.
Root cause: position 164 of the microVM chain (
d109f3e89, microVM: share several host directories through one virtio-fs slot, which no PR of the OpenVMM roadmap maps yet) made microVM aggregates save no node for their synthetic root, node 1, but kept the check of PR18's position 083 (6315c16c5) that the next node ID exceed the saved node IDs only, which covered node 1 while every state saved its root as node 1. Position 083'srestore_microvm_statemakes the saved value the node table's next ID, and upstream's aggregate (microsoft/openvmm#3821) routes every request for node 1 to its synthetic root.The issue's suggested patch,
state.next_node_id > largest_node_id.max(FUSE_ROOT_ID), is the fix, and the test below confirms it.Alternative rejected: refusing node 1 where the node table allocates IDs. The restore would still accept a state that no device saves, and the device would then fail or skip lookups, instead of the restore failing before it changes anything.
How was this change validated?
Checks and results. "Before" is OpenVMM
1633b3797, the head offeature/microvm/dev; "after" is the fix, as2f85df783on1633b3797and, after its rebase onto microsoft/openvmm#5289, as the pinned5f4a47b83, whose patchgit range-diffreports equal. Windows is the local Windows 11 Enterprise (build 26300, NTFS) workstation, and Linux the azure-intel-kvm-7 test VM (Azure Linux 3, kernel 6.18, x86_64, tmpfs), sincepython scripts/nvx_hosts.py select kvm --host-type virtual-machinechose a runner-only host without a Rust toolchain.cargo nextest run --profile agent -p virtiofs -E 'test(children_never_get_the_synthetic_root_node)'(new test), Windows and Linux2f85df783and at5f4a47b83work, list it, save, and restore the saveworkgets node 1, and its listing shows the aggregate's childrentoolsandwork; the save's restore fails with "saved aggregate inode table contains the synthetic root"cargo check,cargo clippy --all-targets, andcargo doc --no-deps, each-p virtiofs2f85df783and at5f4a47b83cargo nextest run --profile agent -p virtiofs5f4a47b83: Windows 250 passed, 3 skipped; Linux 250 passed, 1 skipped. At2f85df783: Windows 241 passed, 3 skipped; Linux 242 passed, 1 skippedcargo xtask fmt --fix2f85df783cargo test --locked --manifest-path nvx/Cargo.toml --no-default-features --test openvmm_vectors -- --ignored, and the same with--test openvmm_cpu_profilesnvxcopies are unchangedpython scripts/openvmm_pin.py source 5f4a47b83591ccbcc4f9a2563b5322603def625b --pr 5290python scripts/openvmm_pin.py check-branch --topic --target origin/agents/issue-2133-virtiofs-unreachable-entries,python scripts/openvmm_pin.py check-roadmap --worktree,python scripts/check_markdown_links.py,git diff --checkpython scripts/local_gates.py --base origin/agents/issue-2133-virtiofs-unreachable-entries --run --only test-changes markdown-links test-layout openvmm-vectors openvmm-cpu-profilespython scripts/local_gates.py --base origin/dev --run --only nvx-cli, before the rebase, with the design-document commit onfb28ca4c3test_private_network_ingress_script_checks_policy_and_traffictimed out its guest script after 10 s, andtest_snapshot_core_detects_regressions_of_snapshots_and_their_restores(faultwaiters-share-the-lock) raised no error; both pass when run alone. Neither this branch nor the branches below it change a scriptAfter the base branch was rebuilt, from
c3f4c024ato9f5bae739, the three commits were rebuilt on it, the roadmap commit on the base's text, which now classifies positions 389, 393, and 396 as PR18 fixups; at71c5f47ac,python scripts/openvmm_pin.py roadmap 5f4a47b83591ccbcc4f9a2563b5322603def625b --target origin/agents/issue-2133-virtiofs-unreachable-entries(position 398, 272 commits past the mapped tip),check-roadmap --worktree,check-branch --topic,git diff --check, and the local gates of the table pass again.Backend, host OS, host type, and guest: KVM on azure-intel-kvm-7 (Azure Linux 3, kernel 6.18, x86_64), a virtual machine, with the Alpine guest and kernel of release
v0.1.0-dev.fb28ca4c3f07. OpenVMM was built from2f85df783and from5f4a47b83withpython3 scripts/nvx.py build-openvmm --backend kvm, whose provenance recorded a clean checkout, andpython3 scripts/nvx.py test-microvm --backend kvm --scenario filesystem-snapshot --scenario platform-aggregate-export --scenario filesystem-sharespassed with both. NVX always exports an aggregate, so these scenarios' snapshots restore aggregate states through the changed check. No scenario crafts the state that the fix refuses, so the unit test above is the reproduction.OpenVMM's CI of the pin, run 45669616533, passed its six required jobs:
unit tests [x64-linux],unit tests [x64-windows], andrun vmm-testsonx64-linux-amd-kvm,x64-linux-intel-mshv,x64-windows-intel, andx64-windows-amd, aspython scripts/nvx.py check-openvmm-ci --revision 5f4a47b83591ccbcc4f9a2563b5322603def625breports.Left to CI: NVX CI's KVM, MSHV, and WHP microVM jobs with OpenVMM built from the pin, MSHV and WHP among them, which no host here ran, and its NVX CLI jobs. CI of the previous head,
1428892d2, passed them all in run 45672415550, whose WHP benchmark job waits for the shared WHP benchmark runner.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/public-api/withpython3 scripts/public_api.py --update.description says how the change versions or migrates them.
Changes to existing tests
None:
python scripts/check_test_changes.py --base origin/agents/issue-2133-virtiofs-unreachable-entrieslists no change to an existing test, and the OpenVMM pull request adds one test and changes none.OpenVMM pin
5f4a47b83591ccbcc4f9a2563b5322603def625b, one commit ona79b4bb40, the head of [DO NOT REVIEW] virtiofs: leave entries that lookups refuse out of microVM listings openvmm#5289, which the base branch pins.a79b4bb40, position 397), open, which openvmm: pin microVM listings that leave out entries that lookups refuse #2156 pins, on #5288 (1495ac815, position 396, openvmm: pin the host open flags of microVM create handles #2155), #5287 (4aeb405d9, position 395, openvmm: pin the refusal of negative virtio-fs offsets on Windows #2154), #5286 (9822f732a, position 394, openvmm: pin hard links to one-character names on Windows #2152), #5285 (5af753b17, position 393, openvmm: pin microVM restores of handles opened with O_DIRECT #2150), #5284 (e61fa5326, position 392, openvmm: pin the refusal of an empty symlink target on Windows #2148), and #5283 (c7f6a04fd, position 391, openvmm: pin the xattr name limit of virtio-fs shares on Windows #2147), all open, on770bc61e7, position 390, the head offeature/microvm/devsince #5281 and #5282 landed positions 389 and 390.2f85df783on1633b3797, on which the evidence before the rebase was collected, asgit range-diffreports; the rebase applied without conflicts. #5282, #5285, and #5288 also change the microVM'sstate.rs, though not the check that this commit changes, and #5283, #5284, #5286, and #5287 changelxutil, on whichvirtiofsdepends, so thevirtiofschecks ran again at the pin, on Windows and Linux.8d4e03132, lacks the microVM's saved state, and replaying the commit there conflicts in the microVM'sstate.rsandaggregate_fs_tests.rs.nvxcopies are unchanged.feature/microvm/devexactly to5f4a47b83591ccbcc4f9a2563b5322603def625b(not with the merge button, which squashes) before this pull request merges;python scripts/openvmm_pin.py land 5f4a47b83591ccbcc4f9a2563b5322603def625b --remote originfinds that fast-forward once #5289 has landed.