patch 'vhost: fix indirect descriptor table double fetch' has been queued to stable release 25.11.5
Kevin Traynor
ktraynor at redhat.com
Thu Dec 3 14:01:38 CET 2026
Hi,
FYI, your patch has been queued to stable release 25.11.5
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 12/08/26. So please
shout if anyone has objections.
Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.
Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable
This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/9fba17d6cc9127591f7401dd8d294bfd4181a5ea
Thanks.
Kevin
---
>From 9fba17d6cc9127591f7401dd8d294bfd4181a5ea Mon Sep 17 00:00:00 2001
From: Maxime Coquelin <maxime.coquelin at redhat.com>
Date: Thu, 17 Sep 2026 11:11:43 +0200
Subject: [PATCH] vhost: fix indirect descriptor table double fetch
[ upstream commit b053a220786fca7915fae98cb41942804456bbe5 ]
The virtio descriptor length field was read multiple times from
guest-controlled memory, creating a TOCTOU (time-of-check-time-of-use)
vulnerability. A malicious guest could exploit this by modifying
desc->len between reads, causing the host to allocate a buffer of
one size but iterate over a different number of descriptors, leading
to an out-of-bounds read.
Affected functions:
- fill_vec_buf_packed_indirect(): desc->len read for allocation at
one point, then re-read for loop bound calculation
- fill_vec_buf_split(): vq->desc[idx].len re-read for allocation
after being captured in a local variable
- vdpa.c indirect descriptor handling: same pattern
Fix by capturing the descriptor length once in a local variable
and using that for all subsequent operations.
Also fix a memory leak in fill_vec_buf_packed_indirect() where
free_ind_table() was not called on the map_one_desc() error path.
CVE-2026-93683
Bugzilla ID: 2046
Fixes: d0c24508e1f7 ("vhost: add support for non-contiguous indirect descs tables")
Fixes: 2f3225a7d69b ("vhost: add vector filling support for packed ring")
Reported-by: Naseeb Dangi <naseebdangi100 at gmail.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin at redhat.com>
Acked-by: Kevin Traynor <ktraynor at redhat.com>
---
.mailmap | 1 +
1 file changed, 1 insertion(+)
diff --git a/.mailmap b/.mailmap
index e362a639ed..f0e533a172 100644
--- a/.mailmap
+++ b/.mailmap
@@ -1179,4 +1179,5 @@ Narcisa Vasile <navasile at linux.microsoft.com> <narcisa.vasile at microsoft.com>
Narender Vangati <narender.vangati at intel.com>
Naresh Kumar PBS <nareshkumar.pbs at broadcom.com>
+Naseeb Dangi <naseebdangi100 at gmail.com>
Natalie Samsonov <nsamsono at marvell.com>
Natanael Copa <ncopa at alpinelinux.org>
--
2.56.1
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2026-12-03 12:52:44.136927277 +0000
+++ 0172-vhost-fix-indirect-descriptor-table-double-fetch.patch 2026-12-03 12:52:39.145881860 +0000
@@ -1 +1 @@
-From b053a220786fca7915fae98cb41942804456bbe5 Mon Sep 17 00:00:00 2001
+From 9fba17d6cc9127591f7401dd8d294bfd4181a5ea Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit b053a220786fca7915fae98cb41942804456bbe5 ]
+
@@ -30 +31,0 @@
-Cc: stable at dpdk.org
@@ -36,4 +37,2 @@
- .mailmap | 1 +
- lib/vhost/vdpa.c | 8 +++++---
- lib/vhost/virtio_net.c | 22 +++++++++++++---------
- 3 files changed, 19 insertions(+), 12 deletions(-)
+ .mailmap | 1 +
+ 1 file changed, 1 insertion(+)
@@ -42 +41 @@
-index 76b0648361..88b854502a 100644
+index e362a639ed..f0e533a172 100644
@@ -45 +44 @@
-@@ -1193,4 +1193,5 @@ Narcisa Vasile <navasile at linux.microsoft.com> <narcisa.vasile at microsoft.com>
+@@ -1179,4 +1179,5 @@ Narcisa Vasile <navasile at linux.microsoft.com> <narcisa.vasile at microsoft.com>
@@ -51,94 +49,0 @@
-diff --git a/lib/vhost/vdpa.c b/lib/vhost/vdpa.c
-index bc2dd8d2e1..ff3b4379aa 100644
---- a/lib/vhost/vdpa.c
-+++ b/lib/vhost/vdpa.c
-@@ -196,5 +196,7 @@ rte_vdpa_relay_vring_used(int vid, uint16_t qid, void *vring_m)
-
- if (vq->desc[desc_id].flags & VRING_DESC_F_INDIRECT) {
-- dlen = vq->desc[desc_id].len;
-+ uint64_t desc_len = vq->desc[desc_id].len;
-+
-+ dlen = desc_len;
- nr_descs = dlen / sizeof(struct vring_desc);
- if (unlikely(nr_descs > vq->size))
-@@ -210,9 +212,9 @@ rte_vdpa_relay_vring_used(int vid, uint16_t qid, void *vring_m)
- return -1;
-
-- if (unlikely(dlen < vq->desc[desc_id].len)) {
-+ if (unlikely(dlen < desc_len)) {
- vhost_user_iotlb_rd_lock(vq);
- idesc = vhost_alloc_copy_ind_table(dev, vq,
- vq->desc[desc_id].addr,
-- vq->desc[desc_id].len);
-+ desc_len);
- vhost_user_iotlb_rd_unlock(vq);
- if (unlikely(!idesc))
-diff --git a/lib/vhost/virtio_net.c b/lib/vhost/virtio_net.c
-index ff4613df68..8bdddedccf 100644
---- a/lib/vhost/virtio_net.c
-+++ b/lib/vhost/virtio_net.c
-@@ -776,5 +776,7 @@ fill_vec_buf_split(struct virtio_net *dev, struct vhost_virtqueue *vq,
-
- if (vq->desc[idx].flags & VRING_DESC_F_INDIRECT) {
-- dlen = vq->desc[idx].len;
-+ uint64_t desc_len = vq->desc[idx].len;
-+
-+ dlen = desc_len;
- nr_descs = dlen / sizeof(struct vring_desc);
- if (unlikely(nr_descs > vq->size))
-@@ -788,5 +790,5 @@ fill_vec_buf_split(struct virtio_net *dev, struct vhost_virtqueue *vq,
- return -1;
-
-- if (unlikely(dlen < vq->desc[idx].len)) {
-+ if (unlikely(dlen < desc_len)) {
- /*
- * The indirect desc table is not contiguous
-@@ -794,5 +796,5 @@ fill_vec_buf_split(struct virtio_net *dev, struct vhost_virtqueue *vq,
- */
- idesc = vhost_alloc_copy_ind_table(dev, vq,
-- vq->desc[idx].addr, vq->desc[idx].len);
-+ vq->desc[idx].addr, desc_len);
- if (unlikely(!idesc))
- return -1;
-@@ -899,8 +901,8 @@ fill_vec_buf_packed_indirect(struct virtio_net *dev,
- uint32_t nr_descs;
- uint16_t vec_id = *vec_idx;
-- uint64_t dlen;
-+ uint64_t desc_len = desc->len;
-+ uint64_t dlen = desc_len;
- struct vring_packed_desc *descs, *idescs = NULL;
-
-- dlen = desc->len;
- descs = (struct vring_packed_desc *)(uintptr_t)
- vhost_iova_to_vva(dev, vq, desc->addr, &dlen, VHOST_ACCESS_RO);
-@@ -908,5 +910,5 @@ fill_vec_buf_packed_indirect(struct virtio_net *dev,
- return -1;
-
-- if (unlikely(dlen < desc->len)) {
-+ if (unlikely(dlen < desc_len)) {
- /*
- * The indirect desc table is not contiguous
-@@ -914,5 +916,5 @@ fill_vec_buf_packed_indirect(struct virtio_net *dev,
- */
- idescs = vhost_alloc_copy_ind_table(dev,
-- vq, desc->addr, desc->len);
-+ vq, desc->addr, desc_len);
- if (unlikely(!idescs))
- return -1;
-@@ -921,5 +923,5 @@ fill_vec_buf_packed_indirect(struct virtio_net *dev,
- }
-
-- nr_descs = desc->len / sizeof(struct vring_packed_desc);
-+ nr_descs = desc_len / sizeof(struct vring_packed_desc);
- if (unlikely(nr_descs >= vq->size)) {
- free_ind_table(idescs);
-@@ -937,6 +939,8 @@ fill_vec_buf_packed_indirect(struct virtio_net *dev,
- if (unlikely(map_one_desc(dev, vq, buf_vec, &vec_id,
- descs[i].addr, dlen,
-- perm)))
-+ perm))) {
-+ free_ind_table(idescs);
- return -1;
-+ }
- }
- *vec_idx = vec_id;
More information about the stable
mailing list