You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When handling FUSE_READDIR or FUSE_READDIRPLUS on an aggregate mount's synthetic root directory, VirtioFs::read_synthetic_root_dir_with reserves the untrusted guest fuse_read_in.size (u32) directly with Vec::with_capacity(size as usize) without checking MAX_GUEST_BUFFER_SIZE or using fallible allocation. A malicious or buggy guest passing size = u32::MAX forces an immediate ~4 GiB heap reservation per request and aborts the host VMM / device process with SIGABRT if memory or cgroup/address-space limits cannot satisfy the allocation. Found by testing.
Any guest with access to an aggregate virtiofs mount (microVM or direct aggregate) can open FUSE_ROOT_ID (1) and issue FUSE_READDIR or FUSE_READDIRPLUS with size = u32::MAX (4_294_967_295). Under a memory-limited or cgroup-constrained VMM/device process, Rust's global allocator OOM handler aborts the entire host process (memory allocation of 4294967295 bytes failed, SIGABRT); even without an immediate OOM abort, concurrent FUSE requests can pin multi-gigabyte allocations per in-flight READDIR call and exhaust host memory.
Reproduction
Construct an aggregate VirtioFs via VirtioFs::new_microvm_aggregate.
Open the synthetic root directory via Fuse::open_dir(&fs, &request(FUSE_ROOT_ID), lx::O_RDONLY as u32) to obtain SYNTHETIC_ROOT_FH.
At the start of VirtioFs::read_synthetic_root_dir_with (after checking self.inner.aggregate()), return Err(lx::Error::E2BIG) when size as usize > crate::MAX_GUEST_BUFFER_SIZE, and replace Vec::with_capacity(size as usize) with Vec::new() followed by buffer.try_reserve_exact(size as usize).map_err(|_| lx::Error::ENOMEM)?, matching VirtioFsFile::read_dir_with and VirtioFsFile::read_dir_microvm. Note that read_synthetic_root_dir_with is also modified at the end of its entry loop when fixing small-buffer EINVAL handling on the synthetic root.
Activity
tangruize commentedon Nov 15, 2026
Suggested Fix
At the start of
VirtioFs::read_synthetic_root_dir_with(after checkingself.inner.aggregate()), returnErr(lx::Error::E2BIG)whensize as usize > crate::MAX_GUEST_BUFFER_SIZE, and replaceVec::with_capacity(size as usize)withVec::new()followed bybuffer.try_reserve_exact(size as usize).map_err(|_| lx::Error::ENOMEM)?, matchingVirtioFsFile::read_dir_withandVirtioFsFile::read_dir_microvm. Note thatread_synthetic_root_dir_withis also modified at the end of its entry loop when fixing small-bufferEINVALhandling on the synthetic root.Patch against OpenVMM
9d64daad3cbe14fb0591081b73c6c9648e18d0fb. Save the contents below asfix.patchand rungit apply fix.patch.fix.patch