CVE-2026-74713: vhost_iotlb: bound map allocation in add_range
In the Linux kernel, the following vulnerability has been resolved:
vhostiotlb: bound map allocation in addrange
vhostiotlbaddrangectx() only retires an old entry when the table has a non-zero limit, has exactly reached that limit and has VHOSTIOTLBFLAGRETIRE set. Non-retiring tables can keep allocating entries after reaching their configured limit.
Existing vhost devices allocate their IOTLB with maxiotlbentries from vhost.c, which defaults to 2048 and is tunable by module parameter. Use the caller-provided limit at the allocation point instead of adding a separate default in the common IOTLB helper, and reject non-positive values in vhost paths that can report an error.
Other vhost IOTLB users should not create zero-limit tables when entries can be populated from userspace or guest-controlled requests. Add caller-side maxiotlbentries parameters for mlx5 vDPA, VDUSE and vhost-vDPA. Reject non-positive VDUSE and vhost-vDPA values, and require at least two entries for vdpasim and mlx5 vDPA paths that install full-range mappings, since those mappings are split into two IOTLB entries.
Handle full-range mappings in the common helper by checking that the IOTLB can hold both split entries before inserting the first half. This avoids returning an error after leaving a half mapping behind.
When the table is full, keep the existing retire behavior for retiring tables and return -ENOSPC for non-retiring tables. Reuse the retired map node instead of freeing it and allocating a replacement, so a stream of IOTLB updates cannot keep forcing GFPATOMIC allocations after the table has reached its limit. If a zero-limit IOTLB still reaches the common helper, treat it as a configuration error and return -EINVAL.
I found this bug myself, though the patch was written with AI assistance.
Affected Software
Event History
Frequently Asked Questions
Are systems using the default setting affected?
Existing vhost devices create their IOTLB with max_iotlb_entries from vhost.c, which defaults to 2048 and can be changed through a module parameter. A configured limit was not reliably enforced for non-retiring tables, so reaching the default limit did not necessarily stop further entry allocation.
What conditions allow the allocation limit to be bypassed?
The issue occurs when an IOTLB table does not retire entries. The previous logic retired an entry only when the limit was non-zero, exactly reached, and VHOST_IOTLB_FLAG_RETIRE was set; non-retiring tables could continue allocating entries beyond the configured limit.
Which mapping sources require particular attention?
IOTLB users that can receive entries from userspace or guest-controlled requests should not create zero-limit tables. The fix also adds caller-side limits for mlx5 vDPA, VDUSE, and vhost-vDPA, rejects non-positive values for VDUSE and vhost-vDPA, and requires at least two entries for vdpa_sim and mlx5 vDPA full-range mappings.