patch 'net/virtio-user: fix resource leak on probing failure' has been queued to stable release 20.11.5

luca.boccassi at gmail.com luca.boccassi at gmail.com
Fri Feb 18 13:38:32 CET 2022


Hi,

FYI, your patch has been queued to stable release 20.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 02/20/22. 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/ac0c52244d8385f60974679742f09c87858b9fbf

Thanks.

Luca Boccassi

---
>From ac0c52244d8385f60974679742f09c87858b9fbf Mon Sep 17 00:00:00 2001
From: Harold Huang <baymaxhuang at gmail.com>
Date: Thu, 23 Dec 2021 12:42:37 +0800
Subject: [PATCH] net/virtio-user: fix resource leak on probing failure

[ upstream commit edca47a1d9e01cb6f9bd174cc1cbefce1af7fd37 ]

When eth_virtio_dev_init is failed, the registered virtio user memory
event cb is not released and the backend created tap device is not
destroyed.  It would cause some residual tap device existed in the host
and creating a new vdev could be failed because the new virtio_user_dev
could use the same address pointer and register memory event cb to the
same address is not allowed.

Fixes: ca8326a94365 ("net/virtio_user: fix error management during init")

Signed-off-by: Harold Huang <baymaxhuang at gmail.com>
Reviewed-by: Chenbo Xia <chenbo.xia at intel.com>
---
 drivers/net/virtio/virtio_user_ethdev.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/virtio/virtio_user_ethdev.c b/drivers/net/virtio/virtio_user_ethdev.c
index 0906a34799..04d6d7e2f4 100644
--- a/drivers/net/virtio/virtio_user_ethdev.c
+++ b/drivers/net/virtio/virtio_user_ethdev.c
@@ -887,6 +887,7 @@ virtio_user_pmd_probe(struct rte_vdev_device *dev)
 	/* previously called by pci probing for physical dev */
 	if (eth_virtio_dev_init(eth_dev) < 0) {
 		PMD_INIT_LOG(ERR, "eth_virtio_dev_init fails");
+		virtio_user_dev_uninit(hw->virtio_user_dev);
 		virtio_user_eth_dev_free(eth_dev);
 		goto end;
 	}
-- 
2.30.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-02-18 12:37:40.405299516 +0000
+++ 0063-net-virtio-user-fix-resource-leak-on-probing-failure.patch	2022-02-18 12:37:37.702792189 +0000
@@ -1 +1 @@
-From edca47a1d9e01cb6f9bd174cc1cbefce1af7fd37 Mon Sep 17 00:00:00 2001
+From ac0c52244d8385f60974679742f09c87858b9fbf Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit edca47a1d9e01cb6f9bd174cc1cbefce1af7fd37 ]
+
@@ -14 +15,0 @@
-Cc: stable at dpdk.org
@@ -23 +24 @@
-index 0271098f0d..16eca2f940 100644
+index 0906a34799..04d6d7e2f4 100644
@@ -26 +27 @@
-@@ -666,6 +666,7 @@ virtio_user_pmd_probe(struct rte_vdev_device *vdev)
+@@ -887,6 +887,7 @@ virtio_user_pmd_probe(struct rte_vdev_device *dev)
@@ -30 +31 @@
-+		virtio_user_dev_uninit(dev);
++		virtio_user_dev_uninit(hw->virtio_user_dev);


More information about the stable mailing list