Skip to contentSkip to conversation

CVE-2026-99686: vhost: fix used ring index wrap in vhost_add_used_n_in_order

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Nov 20

lore
Share & tools
lore
#0 lore raw

From: Greg Kroah-Hartman <[email protected]>

Description
===========

In the Linux kernel, the following vulnerability has been resolved:

vhost: fix used ring index wrap in vhost_add_used_n_in_order

vhost_add_used_n_in_order() 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. log_write() then sets bits beyond the dirty-log bitmap, potentially corrupting adjacent userspace memory. This is reachable on the vhost-net TX path with VIRTIO_F_IN_ORDER: done_idx can reach VHOST_NET_BATCH (64), triggering the issue with a 32-entry ring.

Wrap start with a mask to keep it within the ring. VHOST_SET_VRING_NUM enforces a nonzero power-of-two ring size, allowing start to be wrapped using & (vq->num - 1).

The Linux kernel CVE team has assigned CVE-2026-99686 to this issue.

Affected and fixed versions
===========================

	Issue introduced in 6.17 with commit 67a873df0c410915275f735fedb401b9637d6faf and fixed in 6.18.64 with commit ebdc350cfb1740b6411420482e58a35cc4761628
	Issue introduced in 6.17 with commit 67a873df0c410915275f735fedb401b9637d6faf and fixed in 7.3.5 with commit 308e148cf771ed36ad8cd7ef0e9bee2f7ec478d0
	Issue introduced in 6.17 with commit 67a873df0c410915275f735fedb401b9637d6faf and fixed in 7.4-rc2 with commit e244725e86be02cd85cb878b3ed8570eba2e4be1

Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.

Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at

	https://cve.org/CVERecord/?id=CVE-2026-99686

will be updated if fixes are backported, please check that for the most up to date information about this issue.

Affected files
==============

The file(s) affected by this issue are:
drivers/vhost/vhost.c

Mitigation
==========

The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:

	https://git.kernel.org/stable/c/ebdc350cfb1740b6411420482e58a35cc4761628
	https://git.kernel.org/stable/c/308e148cf771ed36ad8cd7ef0e9bee2f7ec478d0
	https://git.kernel.org/stable/c/e244725e86be02cd85cb878b3ed8570eba2e4be1