patch 'vhost: check descriptor chains length' has been queued to stable release 22.11.8
luca.boccassi at gmail.com
luca.boccassi at gmail.com
Fri Mar 7 13:24:09 CET 2025
Hi,
FYI, your patch has been queued to stable release 22.11.8
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/09/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/bluca/dpdk-stable
This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/01b199177b82c3641f3ae2571ec9ed4e0d1927b7
Thanks.
Luca Boccassi
---
>From 01b199177b82c3641f3ae2571ec9ed4e0d1927b7 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 f16b7c45da..ec8d03d97f 100644
--- a/lib/vhost/virtio_net.c
+++ b/lib/vhost/virtio_net.c
@@ -3586,6 +3586,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.47.2
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2025-03-07 12:23:38.393327990 +0000
+++ 0010-vhost-check-descriptor-chains-length.patch 2025-03-07 12:23:38.002838176 +0000
@@ -1 +1 @@
-From e31b57e732d52f3cd8c707824f79fef8c117df95 Mon Sep 17 00:00:00 2001
+From 01b199177b82c3641f3ae2571ec9ed4e0d1927b7 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 f16b7c45da..ec8d03d97f 100644
@@ -23 +24 @@
-@@ -3960,6 +3960,16 @@ virtio_dev_tx_async_single_packed(struct virtio_net *dev,
+@@ -3586,6 +3586,16 @@ virtio_dev_tx_async_single_packed(struct virtio_net *dev,
@@ -29 +30 @@
-+ VHOST_DATA_LOG(dev->ifname, ERR, "Invalid buffer length.");
++ VHOST_LOG_DATA(dev->ifname, ERR, "Invalid buffer length.\n");
@@ -39 +40 @@
- 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