Repository navigation
openvmm: pin microVM listing bounds that count only shown entries - #2120
Merged
Pedro Henrique Penna (ppenna) merged 3 commits intoNov 25, 2026
Merged
Pedro Henrique Penna (ppenna) merged 3 commits into
Pedro Henrique Penna (ppenna) merged 3 commits into
Conversation
A microVM's virtio-fs listing of a host directory whose shown entries, `.` and `..` included, filled a handle's 4,096 entries failed the guest's first FUSE_READDIR or FUSE_READDIRPLUS of the handle with E2BIG when the host listed an entry that the share's access policy hides after them, and listed them all when the host listed it first, so the outcome depended on the host's enumeration order, which the guest cannot control (#2093). A guest's busybox `ls -a` of such a share printed nothing. The listing checked its bound of 4,096 entries before the policy filter, so a hidden entry counted toward it. Pin microsoft/openvmm 043083f4059c7dfda9d021a8cf983ac65017c91e, the head of microsoft/openvmm#5279, one commit on 44747bf1c, the head of microsoft/openvmm#5278, which NVX pins below this commit: - virtiofs: count only shown entries toward a microVM listing's bound. The check of the 4,096 entries per handle runs after the policy filter, beside the check of 64 KiB of names, so only the entries that the guest can list count toward either bound, and a 4,097th of them still fails the listing with E2BIG. Its test fails without the fix, for the file that the host lists last, and passes with it, on Windows and Linux. The virtiofs package's tests pass at the pin on Windows, and on Linux at 5066e2c84, the same commit on d44a113be before its rebase onto microsoft/openvmm#5278 and the commits below it, which touch none of its files. In an Alpine guest of release v0.1.0-dev.86984fe72c05, whose OpenVMM CI built from d44a113be, `ls -a` of a read-only share of 4,095 files whose policy hides the last file that the host lists printed no name, on KVM (nvx-kvm-test, ext4) and on WHP (Windows 11, NTFS). With OpenVMM built from the fix, 5066e2c84 on KVM and the pinned 043083f40 on WHP, it printed all 4,096 names, and the filesystem-shares, filesystem-snapshot, filesystem-policy, filesystem-owner, denied-filesystem-paths, filesystem-comma-paths, platform-filesystem, and platform-aggregate-export scenarios passed 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>
…the OpenVMM roadmap Map position 385, the commit of microsoft/openvmm#5279, which NVX now pins at 043083f40, 259 commits past the mapped tip, on 44747bf1c, position 384, the head of microsoft/openvmm#5278: - 385, virtiofs: count only shown entries toward a microVM listing's bound. The listing that the first read of a microVM directory handle takes checks its bound of 4,096 entries after the access-policy filter, beside its bound of 64 KiB of names, so that an entry that the policy hides no longer fails with E2BIG a listing whose shown entries fill the bound (#2093). Its test lowers the bound through the new build_microvm_directory_snapshot_within. Position 385 is not yet assigned to a PR. It fixes a defect of PR18's position 083, whose build_microvm_directory_snapshot checked the bound before the filter that skips the entries that PR22's position 102's denied paths and position 160's traverse-only directories hide, but its code follows position 371's loop and its test needs PR22's position 102 and positions 164 and 335, so it is not a PR18 fixup. Positions 160, 330, 346, 349, 354, 355, and 371 also change the microVM's file.rs, and none of positions 372-384 changes its files. Upstream main, 8d4e03132, lacks the defect, since it lacks the microVM's listings, and replaying the commit there conflicts in the microVM's file.rs and fs_tests.rs, which upstream main lacks, so it cannot go upstream on its own. The Scope also names the head of feature/microvm/dev, fa239c823, since microsoft/openvmm#5275, microsoft/openvmm#5276, and microsoft/openvmm#5277 landed positions 381-383. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The host filesystem's design said that the first directory read on a handle lists the host directory into at most 4,096 entries and 64 KiB of names, without the entries that the access policy hides, and that listing a larger directory fails with E2BIG. OpenVMM checked the entry bound before the policy filter, so a directory whose shown entries filled a listing failed with E2BIG once the host listed a hidden entry after them (#2093). With the OpenVMM fix, only the shown entries count toward either bound, so say so, and say that a directory fails the listing when it shows more than the bounds hold. Say too that a name longer than 255 bytes fails a listing with EINVAL whether the policy hides it or not, since the listing checks names before the filter. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Pedro Henrique Penna (ppenna)
force-pushed
the
agents/issue-2093-virtiofs-hidden-entries
branch
from
November 25, 2026 04:51
0aa1c4d to
16b520d
Compare
5 tasks done
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block the OpenVMM pin and directory-listing documentation updates.
No open issues 🎉
What changed in this PR
This PR pins the OpenVMM fix for #2093, making microVM directory-listing bounds count only policy-visible entries. This removes failures that depended on whether the host enumerated hidden entries before or after visible ones.
Changes:
- Updates the OpenVMM roadmap for revision
043083f40, chain position 385, including its dependencies and upstream status. - Clarifies that hidden entries consume neither listing bound, while names longer than 255 bytes still cause
EINVALeven when hidden.
| File | Description |
|---|---|
doc/openvmm-upstream-roadmap.md |
Records the new pin, updates chain counts, and explains the listing-bound fix. |
doc/design/3.6-host-filesystem.md |
Clarifies policy-filtered listing limits and oversized-name errors. |
Review effort: Balanced
Pedro Henrique Penna (ppenna)
deleted the
agents/issue-2093-virtiofs-hidden-entries
branch
November 25, 2026 06:11
5 tasks done
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 #2093
Stacked on #2119 (
agents/issue-1909-io-uring-start), itself stacked on #2118 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 guest's virtio-fs listing of a host directory now counts only the entries that the share's access policy shows toward a handle's bounds of 4,096 entries and 64 KiB of names. Before, an entry that
--mount-denyhides, or that a traverse-only directory of--mount-allowhides, counted toward the 4,096 entries too, so a directory whose shown entries,.and..included, filled that bound failed the guest's firstREADDIRorREADDIRPLUSwithE2BIGwhen the host listed a hidden entry after them, and listed them all when the host listed the hidden entries first. The outcome thus depended on the host's enumeration order, which the guest cannot control: hiding the last name failed the listing on NTFS, which lists names in order, and hiding whichever name its hash order puts last failed it on ext4. A guest's busyboxls -aof such a share printed no name. A directory that shows more than 4,096 entries, or more than 64 KiB of names, still fails withE2BIG.The fix is in OpenVMM, microsoft/openvmm#5279, which this pull request pins:
virtiofs: count only shown entries toward a microVM listing's bound.VirtioFsFile::build_microvm_directory_snapshot(vm/devices/virtio/virtiofs/src/microvm/file.rs), which lists a handle's directory at its first read, checks the bound of 4,096 entries where an entry is about to join the listing, after the access-policy filter and beside the existing check of 64 KiB of names, rather than at the top of itsread_dircallback. It lists through a newbuild_microvm_directory_snapshot_within, whose bound a test can lower. One regression test inmicrovm/fs_tests.rs.The NVX commits are the gitlink-only pin; the mapping of the commit, position 385, in the OpenVMM roadmap; and two sentences of Nodes, Handles, and Listings that say that the entries that the policy hides count toward neither bound, and that a name longer than 255 bytes fails a listing with
EINVALwhether the policy hides it or not. Start with the OpenVMM diff:git diff --submodule=diff origin/agents/issue-1909-io-uring-start...HEAD.Left out and limitations:
EINVALeven when the policy hides it; this pull request leaves that check as it is.Why is this change needed?
Root cause: position 083 of the microVM chain (
6315c16c5, in PR18 of the OpenVMM roadmap), which introduced the listings of microVM directory handles, checked the bound of 4,096 entries at the top of the callback thatLxFile::read_dircalls for each entry, before the filter that skips the entries that the policy hides: those thatchild_pathrefuses withEACCES, as PR22's position 102 (9f1580ceb) made denied paths do, and, since position 160 (2ea6f1e0b), those thatentry_listableleaves out of a traverse-only directory. A hidden entry thus counted toward the bound as if it were listed, while the check of 64 KiB of names, which runs after the filter, never counted hidden names. Position 371 (2bb009b01, #2096), which reads a listing on to the end of the directory on Windows, kept that order; its pull request recorded this defect as a known limitation and tracked it here.Alternatives rejected:
cfg(test): it would change the bound for every other test of the package, among them those of the saved-state bounds.How was this change validated?
Checks and results. "Before" is OpenVMM
d44a113be, the head offeature/microvm/devwhen this work started, or the release built from it; "after" is the fix, as5066e2c84ond44a113beand, after its rebase onto microsoft/openvmm#5278, as the pinned043083f40, whose patchgit range-diffreports equal.cargo nextest run --profile agent -p virtiofs -E 'test(microvm_listings_count_only_the_entries_that_the_policy_shows)'(new test), on Windows 11 (NTFS) and Linux (tmpfs)E2BIGfor the file that the host lists last,con NTFS andaon tmpfs.and.., the policy hiding no file, the first that the host lists, or the last, then the firstREADDIRandREADDIRPLUSof the root, on Windows and LinuxE2BIG; first: 4,096 entriesE2BIG; first and last: 4,096 entriescargo check,cargo clippy --all-targets, and, on Windows,cargo doc --no-deps, each-p virtiofsd44a113be, andclippyagain on Windows at043083f40cargo nextest run --profile agent -p virtiofs043083f40); Linux: 242 passed, 1 skipped (the fix ond44a113be)cargo xtask fmt --fix5066e2c84)cargo 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 check-branch --topic --target origin/agents/issue-1909-io-uring-start,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-1909-io-uring-start --run --only test-changes markdown-links test-layout openvmm-vectors openvmm-cpu-profiles openvmm-cipython scripts/nvx.py check-openvmm-ci --revision 043083f4059c7dfda9d021a8cf983ac65017c91eBackend, host OS, host type, and guest: KVM on nvx-kvm-test (Azure Linux 3, kernel 6.18, x86_64), a virtual machine; WHP on the local Windows 11 Enterprise (build 26300) workstation, whose host type is not classified; the Alpine guest and kernel of release
v0.1.0-dev.86984fe72c05, whose OpenVMM CI built fromd44a113be(the "before" OpenVMM). The "after" OpenVMM was built from5066e2c84on KVM (python3 scripts/nvx.py build-openvmm --backend kvm) and from043083f40on WHP (python scripts\nvx.py build-openvmm --backend whp).ls -a | wc -lof a read-only share of 4,095 files--mount-deny--mount-denyWith the "after" OpenVMM on KVM,
python3 scripts/nvx.py test-microvm --backend kvmwith thefilesystem-shares,filesystem-snapshot,filesystem-policy,filesystem-owner,denied-filesystem-paths,filesystem-comma-paths,platform-filesystem, andplatform-aggregate-exportscenarios passed. On WHP, with OpenVMM built from the pin andnvxfrom this branch,python scripts\nvx.py test-microvm --backend whpwith the same scenarios butfilesystem-owner, which needs a Linux host, passed.OpenVMM's CI of the pin, run 45527765719, passed the six jobs that NVX requires on its second attempt. The first lost
run vmm-tests [x64-linux-amd-kvm]to the 600 s timeout ofmultiarch::pcie::openvmm_uefi_x64_windows_datacenter_core_2025_x64_virtio_net_kdnet_windows, a Windows guest whose frame buffer stopped changing, a test that this change does not reach and that the same job passed at44747bf1cfor microsoft/openvmm#5278; one rerun of the failed jobs passed it.run vmm-tests [x64-windows-amd-snp], which NVX does not require, fails at microsoft/openvmm#5277 and #5278 too.nvx-kvm-test stopped responding after the rebase, so the Linux runs of the
virtiofstests at the rebased043083f40are OpenVMM CI'sunit tests [x64-linux], which passed.NVX CI run 45549635881 of the head
16b520dadpassed, its KVM, MSHV, and WHP microVM jobs with OpenVMM built from the pin and its NVX CLI jobs on Linux and Windows among them; MSHV, which no host here ran, is covered only there.The
nvx-clilocal gate, whose Python tests this branch does not change, since it changes no script, was stopped in favor of CI's NVX CLI jobs after 1,011 of its tests had passed on this loaded workstation and four had failed. Rerun alone, two of the four passed;test_private_network_ingress_script_checks_policy_and_traffictimed out its guest script after 10 s, as such script tests do on this loaded host, andtest_build_refuses_inputs_that_the_source_identity_omitsexpects its "file outside the checkout" to be outside it, while these runs kept their temporary directories inside the worktree.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-1909-io-uring-startlists no change to an existing test, and the OpenVMM pull request adds one test and changes none.OpenVMM pin
043083f4059c7dfda9d021a8cf983ac65017c91e, one commit on44747bf1c, the head of [DO NOT REVIEW] pal_async: report why a driver cannot set up its io-uring openvmm#5278, which the base branch pins.44747bf1c, position 384), open, which sandbox: report why OpenVMM fails during startup, such as an io-uring set-up error #2119 pins. It followsfa239c823, position 383, the head offeature/microvm/devsince [DO NOT REVIEW] virt_whp: write no internal activity state with the user-mode APIC openvmm#5277 landed it; [DO NOT REVIEW] vm_topology: refuse host VPs per socket outside the builder's range openvmm#5271, #5272, #5273, #5275, #5276, and #5277 have landed positions 378-383.5066e2c84ond44a113be, on which the Linux and KVM evidence above was collected, asgit range-diffreports; the rebase onto [DO NOT REVIEW] pal_async: report why a driver cannot set up its io-uring openvmm#5278 applied without conflicts, and positions 376-384 change none of its files.8d4e03132, lacks the microVM's listings, and replaying the commit there conflicts. The roadmap's Scope also namesfa239c823as the head offeature/microvm/dev, since [DO NOT REVIEW] virt_kvm: refuse to save a vCPU in an SEV-ES AP reset hold openvmm#5275, #5276, and #5277 landed after the base branch mapped its commits.nvxcopies are unchanged.feature/microvm/devexactly to043083f4059c7dfda9d021a8cf983ac65017c91e(not with the merge button, which squashes) before this pull request merges;python scripts/openvmm_pin.py land 043083f4059c7dfda9d021a8cf983ac65017c91e --remote originfinds that fast-forward once #5278 has landed.