Repository navigation
openvmm: pin the refusal of unoffered FUSE_INIT flags - #1870
Merged
Merged
Conversation
OpenVMM's FUSE session asserted that the flags that a file system's init wants are among those that the guest offered in FUSE_INIT (#1630), so a file system that wanted a flag that the guest left out panicked, which aborts the VMM. It also read the guest's capabilities back from the SessionInfo that init may replace, so an init that claimed every capability passed the check, replied flags that the guest never offered, and saved a version and capabilities that the guest never sent. Of the file systems that NVX runs, VirtioFs wants only flags that the guest offers, and SectionFs and the dormant microVM file system keep the default init, so NVX's guests never reached either. Pin microsoft/openvmm 32c0c2bbc90a3f7632386b87a524c71b7e11ecc9, one commit on feature/microvm/dev 51e9af75d: - fuse: fail FUSE_INIT when init wants flags the client did not offer. dispatch_init keeps the version and the guest's capabilities across init, and fails FUSE_INIT with EIO and a rate-limited error, leaving the session uninitialized with no negotiation to save, when init wants a flag, or an extended flag while it keeps FUSE_INIT_EXT, that the guest did not offer. Fuse::init documents both. Its tests pass with the fix; without it, one panics on the assertion and the other gets no error reply, 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>
Map position 331, the commit of microsoft/openvmm#5200, which NVX now pins at 32c0c2bbc, 205 commits past the mapped tip: - 331, fuse: fail FUSE_INIT when init wants flags the client did not offer. Session::dispatch_init fails FUSE_INIT with EIO and a rate-limited error, and leaves the session uninitialized with no negotiation to save, when the file system's init wants a flag, or, while it keeps FUSE_INIT_EXT, an extended flag, that the guest did not offer, and it keeps the version and the guest's capabilities across init. It asserted the bound, so such a file system panicked, which aborts the VMM, and read the capabilities back from the SessionInfo that init may replace with one converted from a SessionInfoState. It is not a fixup of a mapped PR: it changes nothing that one adds. Position 331 changes dispatch_init in session.rs, whose lines that it changes upstream main has and no earlier chain commit changes, documents Fuse::init in lib.rs, which positions 047, 324, 326, 329, and 330 also change, and adds its tests, which use the harness and PR13's session state, in a new file that it declares in the session's test module. The replacement that it stops needs PR13's position 047, which made SessionInfo convertible from SessionInfoState, so the roadmap asks that PR13 go upstream with it. Upstream main, bf353460f, has the two assertions; replaying the commit there conflicts only in the test module's declarations, and without its tests its change applies there and fuse type-checks, but its tests need what upstream main lacks. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
Maintainer confirmation is needed because exact-pin OpenVMM CI remains pending and microsoft/openvmm#5200 has not been fast-forwarded onto feature/microvm/dev.
No open issues 🎉
What changed in this PR
Pins microsoft/openvmm#5200 to address #1630: unoffered FUSE_INIT flags return EIO instead of aborting the VMM, and negotiation preserves the guest’s version and capabilities.
Changes:
- Records pin
32c0c2bbcat chain position 331, 205 commits beyond the mapped tip. - Documents the fix’s behavior, upstream dependencies, and why NVX’s existing filesystems remain unaffected.
| File | Description |
|---|---|
doc/openvmm-upstream-roadmap.md |
Updates the pin, chain counts, graph, and commit mapping; explains the negotiation fix and upstream prerequisites. |
Review effort: Balanced
Pedro Henrique Penna (ppenna)
deleted the
agents/issue-1630-init-flags
branch
November 21, 2026 08:04
This was referenced Nov 21, 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 #1630
What does this pull request change?
It pins microsoft/openvmm#5200, which makes OpenVMM's
fuse::SessionfailFUSE_INITwithEIO, instead of panicking, when the file system'sFuse::initwants a flag that the guest did not offer, and keeps the guest's version and capabilities wheninitreplaces the session information.Session::dispatch_initfills aSessionInfofrom the guest'sFUSE_INIT, lets the file system negotiate inFuse::init(&mut SessionInfo), and then asserted that whatinitwants is among what the guest offered, withassert!(info.want & !info.capable == 0)and, unlessinitdroppedFUSE_INIT_EXT,assert!(info.want2 & !info.capable2 == 0). It now takes the version and the guest's capabilities beforeinitand restores them after it, and wheninitwants a flag, or, while it keepsFUSE_INIT_EXT, an extended flag, that the guest did not offer, it logs a rate-limited error, resets the session information, so that the session stays uninitialized and saves no negotiation, and fails the request withEIO, whichSession::dispatchsends as its error reply.Fuse::initnow documents both. A negotiation within the offer is replied and saved as before.NVX's virtio-fs file systems never want an unoffered flag:
VirtioFs::initwants only flags thatinfo.capable()andinfo.capable2()hold, andSectionFsand the dormant microVM file system keep the defaultinit. So NVX's guests see no change: they negotiate, mount, and restore as before. The fix matters to any otherFuseimplementation that afuse::Sessionserves.No version is created or bumped: no ABI, machine-contract, time-ABI, snapshot, manifest, saved-state, or protocol version changes, in NVX or in OpenVMM, and no saved state or on-disk format changes.
Commits:
openvmm: pin the refusal of unoffered FUSE_INIT flagsmoves the gitlink from51e9af75dto32c0c2bbc90a3f7632386b87a524c71b7e11ecc9, the head of [DO NOT REVIEW] fuse: fail FUSE_INIT when init wants flags the client did not offer openvmm#5200, and changes nothing else. The protocol vectors and CPU profiles thatnvxcopies are unchanged.doc: map the refusal of unoffered FUSE_INIT flags in the OpenVMM roadmapmaps the new chain position, 331.Start with
dispatch_initin microsoft/openvmm#5200'svm/devices/support/fs/fuse/src/session.rs, then its tests insrc/session/tests/init.rs.It leaves out what does not follow from the issue:
Fuse::destroyis still not called after a refusedinit, which no NVX file system needs, sinceVirtioFs, which records its negotiation ininit, never wants an unoffered flag, so the session never refuses it; and aFUSE_INITwhose reply cannot be sent still leaves the negotiated values in an uninitialized session, as before. No NVX documentation describes this negotiation's failure:doc/design/3.6-host-filesystem.mddescribes whatVirtioFsgrants, which does not change. So no NVX documentation changes.Why is this change needed?
The guest decides what
FUSE_INIToffers, throughfuse_init_in.flagsandflags2, and OpenVMM setspanic = 'abort'in both itsdevandreleaseprofiles, so aFusefile system that wanted a flag without checkinginfo.capable()aborted the whole VMM whenever a guest left that flag out, instead of failingFUSE_INIT. TheFusetrait documented no such bound. The assertions also read the guest's capabilities back from theSessionInfothatinitmay change: itsmajor,minor,capable, andcapable2are private, butSessionInfoconverts from the publicSessionInfoState, whose fields are public, so aninitthat replaced it with one that claimed every capability passed both assertions, replied flags that the guest never offered, and left inSession::save_state()a version and capabilities that the guest never sent. The assertions are upstream OpenVMM's: upstream main,bf353460f, has the same two. The conversion is the chain's: position 047,fuse: save and restore negotiated session state, addedSessionInfoStateand madeSessionInfoCopyand convertible from it.EIOis whatdispatch_initalready answers its other failures ofFUSE_INITwith, such as an unsupported version. libfuse refuses the same negotiation withEPROTO(want_flags_valid()indo_init()), but the Linux FUSE driver treats any error reply toFUSE_INITalike, as a connection error (process_init_reply()), so the code makes no difference to the guest. The error log is rate-limited, since a guest can repeatFUSE_INIT.Rejected: masking
wantandwant2to the offer, which would silently drop flags that the file system relies on; and the issue's tests, which read replies throughCapturingSender, which keeps only the last one. The tests instead use the session's test harness, which requires exactly one reply to each request, in a test file of their own. The fix itself is the one that the issue proposes.How was this change validated?
Checks and results:
OpenVMM, with Rust 1.97.1,
cargo nextest run --profile agent -p fuse, with the fix reverted (session.rsandlib.rsof51e9af75d, with the new test module declared) and with it:init_rejects_flags_the_client_did_not_offerpanics withassertion failed: info.want & !info.capable == 0atsession.rs:490, and, with only itsflags2case, withassertion failed: info.want2 & !info.capable2 == 0atsession.rs:496;init_keeps_the_client_version_and_capabilitiesgets no error reply (0, not-5), and, with only its second case, the session saves(8, 0, 0xffffffff, 0xffffffff)instead of the guest's(7, 31, 1, 0)fuse_hello, which needs root)At the pin, on both hosts,
cargo check,cargo clippy --all-targets, andcargo doc --no-depsforfusepass, with no warning but, on Windows, theLNK4199linker message that every linked artifact gets on this machine; on Windows,cargo xtask fmt --fixchanges nothing; on nvx-kvm-test,cargo nextest run --profile agent -p virtiofspasses (171 pass, 1 skipped). Before the rebase onto51e9af75d, the same fix behaved the same on85c3698f9, on both hosts, and on3eb7500fd, on Windows.python scripts/local_gates.py --base origin/dev --only test-changes markdown-links test-layout openvmm-vectors openvmm-cpu-profiles --runon Windows: all five pass.python scripts/openvmm_pin.py check-branch --topic, againstc753e7b4c28, this branch's base ondev, andcheck-roadmap --worktreepass,python scripts/openvmm_pin.py source 32c0c2bbc90a3f7632386b87a524c71b7e11ecc9 --pr 5200reports a good signature and the pull request's head, andpython scripts/nvx.py verifyandpython scripts/check_markdown_links.pypass.MicroVM scenarios at this head on nvx-kvm-test, with OpenVMM built from the pin by
python3 scripts/nvx.py build-openvmm --backend kvm(its provenance names32c0c2bbc, clean) and the other artifacts of releasev0.1.0-dev.b0176f4f543e, fromnvx download --hypervisor kvm: the virtio-fs scenariosplatform-filesystem,filesystem-snapshot,filesystem-shares,filesystem-policy,filesystem-owner,denied-filesystem-paths,platform-aggregate-export, andfilesystem-comma-pathspass, each withpython3 scripts/nvx.py test-microvm --backend kvm --scenario NAME. Each guest mount negotiatesFUSE_INITthrough the changeddispatch_init, andfilesystem-snapshotrestores the negotiation that it saves.filesystem-ownerran unprivileged, so OpenVMM could not assume other host identities, and it checked that guest root and foreign callers fail withEPERM.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 scenarios ran on nvx-kvm-test, on KVM, with the Alpine guest.
Left to CI: the full NVX matrix, on KVM, MSHV, and WHP, which passed for this head in run 44876923910; and OpenVMM's CI of the pin, run 44875530937, which passed every job that the
openvmm-cijob requires, aspython scripts/nvx.py check-openvmm-ci --revision 32c0c2bbc90a3f7632386b87a524c71b7e11ecc9confirms:unit tests [x64-linux],unit tests [x64-windows], andrun vmm-testsofx64-linux-amd-kvm,x64-linux-intel-mshv,x64-windows-intel, andx64-windows-amd. Its other unit-test jobs, on aarch64 Linux and Windows and on x64 and aarch64 musl, passed too, and so did its quick check,cargo hack, binary-size jobs, and therun vmm-testsofaarch64-windows,x64-linux-amd-snp-mshv,x64-windows-intel-tdx, andx64-windows-intel-mi-secure. One job that NVX does not require failed,run vmm-tests [x64-windows-amd-snp], in two Hyper-V SEV-SNP OpenHCL tests,snp_vmgstool_copy_igvmfileandsnp_seal_signer, neither of them a virtio-fs test.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.
OpenVMM pin
51e9af75d, the head offeature/microvm/dev:32c0c2bbcfuse: fail FUSE_INIT when init wants flags the client did not offer.32c0c2bbc90a3f7632386b87a524c71b7e11ecc9, the pull request's exact head.feature/microvm/devat51e9af75d, NVX's previous pin, where [DO NOT REVIEW] fuse: reply to FUSE_IOCTL with the file system's output openvmm#5176 (openvmm: fuse: FUSE_IOCTL reply sends request input data instead of filesystem output #1615) added the session's test harness that the tests use, [DO NOT REVIEW] fuse: fail a reply longer than the request allows with EIO openvmm#5195 (openvmm: fuse: data reply exceeding requested size panics in Session::send_max_size #1629) made it require exactly one reply to each request, and position 047 added the session state that a test checks.85c3698f9, with its tests inline insession.rs, on Windows and on nvx-kvm-test, atb7b044b8d, and on3eb7500fd, with its tests ininit.rs, on Windows, at1a41e235f, each then the head of a work-in-progress branch since deleted.fusetype-checks. The pin is 205 commits past the mapped tip.feature/microvm/devto32c0c2bbc90a3f7632386b87a524c71b7e11ecc9(OpenVMM's merge button squashes, which would leave the pin off the branch); then merge this pull request.