patch 'vhost: check descriptor chains length' has been queued to stable release 23.11.4
Xueming Li
xuemingl at nvidia.com
Tue Apr 8 09:44:38 CEST 2025
Hi,
FYI, your patch has been queued to stable release 23.11.4
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/10/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://git.dpdk.org/dpdk-stable/log/?h=23.11-staging
This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=15b6460353de1a96760ed2a5d66e887a4d6bf07a
Thanks.
Xueming Li <xuemingl at nvidia.com>
---
>From 15b6460353de1a96760ed2a5d66e887a4d6bf07a 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
Cc: Xueming Li <xuemingl at nvidia.com>
[ 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 d81b518462..da14271c6d 100644
--- a/lib/vhost/virtio_net.c
+++ b/lib/vhost/virtio_net.c
@@ -3932,6 +3932,16 @@ virtio_dev_tx_async_single_packed(struct virtio_net *dev,
VHOST_ACCESS_RO) < 0))
return -1;
+ if (unlikely(buf_len <= dev->vhost_hlen)) {
+ if (!allocerr_warned) {
+ VHOST_LOG_DATA(dev->ifname, ERR, "Invalid buffer length.\n");
+ allocerr_warned = true;
+ }
+ return -1;
+ }
+
+ buf_len -= dev->vhost_hlen;
+
if (unlikely(virtio_dev_pktmbuf_prep(dev, pkts, buf_len))) {
if (!allocerr_warned) {
VHOST_LOG_DATA(dev->ifname, ERR, "Failed mbuf alloc of size %d from %s.\n",
--
2.34.1
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2025-04-08 15:39:06.405682226 +0800
+++ 0013-vhost-check-descriptor-chains-length.patch 2025-04-08 15:39:05.896436591 +0800
@@ -1 +1 @@
-From e31b57e732d52f3cd8c707824f79fef8c117df95 Mon Sep 17 00:00:00 2001
+From 15b6460353de1a96760ed2a5d66e887a4d6bf07a Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit e31b57e732d52f3cd8c707824f79fef8c117df95 ]
@@ -11 +13,0 @@
-Cc: stable at dpdk.org
@@ -20 +22 @@
-index 0bf49169db..0348e8dac3 100644
+index d81b518462..da14271c6d 100644
@@ -23 +25 @@
-@@ -3960,6 +3960,16 @@ virtio_dev_tx_async_single_packed(struct virtio_net *dev,
+@@ -3932,6 +3932,16 @@ virtio_dev_tx_async_single_packed(struct virtio_net *dev,
@@ -29 +31 @@
-+ VHOST_DATA_LOG(dev->ifname, ERR, "Invalid buffer length.");
++ VHOST_LOG_DATA(dev->ifname, ERR, "Invalid buffer length.\n");
@@ -39 +41 @@
- VHOST_DATA_LOG(dev->ifname, ERR, "Failed mbuf alloc of size %d from %s.",
+ VHOST_LOG_DATA(dev->ifname, ERR, "Failed mbuf alloc of size %d from %s.\n",
More information about the stable
mailing list