CVE-2026-99686: vhost: fix used ring index wrap in vhost_add_used_n_in_order
In the Linux kernel, the following vulnerability has been resolved:
vhost: fix used ring index wrap in vhostaddusedninorder
vhostaddusedninorder() advances start by nheads[i] but wraps it with a single subtraction. If start + nheads[i] >= 2 vq->num, start can remain outside the ring.
With used-ring logging enabled, start > vq->num makes (vq->num - start) underflow. logwrite() then sets bits beyond the dirty-log bitmap, potentially corrupting adjacent userspace memory. This is reachable on the vhost-net TX path with VIRTIOFINORDER: doneidx can reach VHOSTNETBATCH (64), triggering the issue with a 32-entry ring.
Wrap start with a mask to keep it within the ring. VHOSTSETVRINGNUM enforces a nonzero power-of-two ring size, allowing start to be wrapped using & (vq->num - 1).
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.18.64 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.5 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.1.176-1Fixed in 6.1.192-2Fixed in 6.12.107-1Fixed in 6.12.117-1Fixed in 7.3.5-1 - Compensating control
In vhost_add_used_n_in_order(), wrap start with a mask using & (vq->num - 1) instead of a single subtraction.
Event History
Frequently Asked Questions
Which deployments are exposed to this issue?
The issue is reachable on the vhost-net transmit path when VIRTIO_F_IN_ORDER is enabled and used-ring logging is enabled. A 32-entry virtqueue is specifically described as vulnerable when done_idx reaches the vhost-net batch size of 64.
What does an attacker or triggering workload need to do?
The triggering condition requires advancing the used-ring start index by enough heads that start plus nheads[i] reaches at least twice the virtqueue size. On the vhost-net TX path, batching can produce done_idx 64, which triggers this with a 32-entry ring.
What is the impact when the condition is reached?
The out-of-range start value causes an underflow in the used-ring logging calculation. The resulting dirty-log write can set bits beyond the dirty-log bitmap and potentially corrupt adjacent userspace memory.
Are arbitrary ring sizes affected?
The described wrap logic relies on virtqueue ring sizes being nonzero powers of two, as enforced by VHOST_SET_VRING_NUM. The documented trigger is a 32-entry ring; the vulnerable condition depends on the index advance reaching at least twice the configured ring size.