patch 'vhost: check descriptor chains length' has been queued to stable release 24.11.2

Kevin Traynor ktraynor at redhat.com
Fri Mar 7 13:46:52 CET 2025


Hi,

FYI, your patch has been queued to stable release 24.11.2

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/12/25. 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/3cd431c14cbe9e4f54f4748f4edc852ff56afd3c

Thanks.

Kevin

---
>From 3cd431c14cbe9e4f54f4748f4edc852ff56afd3c Mon Sep 17 00:00:00 2001
From: Yunjian Wang <wangyunjian at huawei.com>
Date: Mon, 23 Dec 2024 11:29:21 +0800
Subject: [PATCH] vhost: check descriptor chains length

[ upstream commit e31b57e732d52f3cd8c707824f79fef8c117df95 ]

The descriptor chains length must be greater than the Virtio-net
header size. Otherwise, such descriptor chains sizes implies no
packet data.

Fixes: fe8477ebbd94 ("vhost: support async packed ring dequeue")

Signed-off-by: Yunjian Wang <wangyunjian at huawei.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin at redhat.com>
---
 lib/vhost/virtio_net.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/lib/vhost/virtio_net.c b/lib/vhost/virtio_net.c
index d85c0c9d42..9a670df274 100644
--- a/lib/vhost/virtio_net.c
+++ b/lib/vhost/virtio_net.c
@@ -3968,4 +3968,14 @@ virtio_dev_tx_async_single_packed(struct virtio_net *dev,
 		return -1;
 
+	if (unlikely(buf_len <= dev->vhost_hlen)) {
+		if (!allocerr_warned) {
+			VHOST_DATA_LOG(dev->ifname, ERR, "Invalid buffer length.");
+			allocerr_warned = true;
+		}
+		return -1;
+	}
+
+	buf_len -= dev->vhost_hlen;
+
 	if (unlikely(virtio_dev_pktmbuf_prep(dev, pkts, buf_len))) {
 		if (!allocerr_warned) {
-- 
2.48.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2025-03-07 11:02:57.598497955 +0000
+++ 0019-vhost-check-descriptor-chains-length.patch	2025-03-07 11:02:56.859335652 +0000
@@ -1 +1 @@
-From e31b57e732d52f3cd8c707824f79fef8c117df95 Mon Sep 17 00:00:00 2001
+From 3cd431c14cbe9e4f54f4748f4edc852ff56afd3c Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit e31b57e732d52f3cd8c707824f79fef8c117df95 ]
+
@@ -11 +12,0 @@
-Cc: stable at dpdk.org
@@ -20 +21 @@
-index 0bf49169db..0348e8dac3 100644
+index d85c0c9d42..9a670df274 100644
@@ -23 +24 @@
-@@ -3961,4 +3961,14 @@ virtio_dev_tx_async_single_packed(struct virtio_net *dev,
+@@ -3968,4 +3968,14 @@ virtio_dev_tx_async_single_packed(struct virtio_net *dev,



More information about the stable mailing list