patch 'net/virtio-user: fix leak when initialisation fails' has been queued to stable release 21.11.5

Kevin Traynor ktraynor at redhat.com
Thu Jul 20 17:18:28 CEST 2023


Hi,

FYI, your patch has been queued to stable release 21.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 07/25/23. 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/77145940b5b8c8de00afd24cd3edb45dd095705b

Thanks.

Kevin

---
>From 77145940b5b8c8de00afd24cd3edb45dd095705b Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand at redhat.com>
Date: Thu, 13 Apr 2023 12:10:41 +0200
Subject: [PATCH] net/virtio-user: fix leak when initialisation fails

[ upstream commit c8254ef1a96c4897293b1d1db8c8a786dfb19e9d ]

Caught with ASan.
If initialising a virtio_user port fails, we may leak the ifname passed
via a devargs.

Fixes: 4214a1b493f2 ("net/virtio-user: support changing tap interface name")

Signed-off-by: David Marchand <david.marchand at redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin at redhat.com>
Acked-by: Tyler Retzlaff <roretzla at linux.microsoft.com>
---
 drivers/net/virtio/virtio_user/virtio_user_dev.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c b/drivers/net/virtio/virtio_user/virtio_user_dev.c
index f9cada05e4..4044774ea0 100644
--- a/drivers/net/virtio/virtio_user/virtio_user_dev.c
+++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c
@@ -586,9 +586,5 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues,
 	dev->unsupported_features = 0;
 	dev->backend_type = backend_type;
-
-	if (*ifname) {
-		dev->ifname = *ifname;
-		*ifname = NULL;
-	}
+	dev->ifname = *ifname;
 
 	if (virtio_user_dev_setup(dev) < 0) {
@@ -663,4 +659,5 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues,
 	}
 
+	*ifname = NULL;
 	return 0;
 }
-- 
2.41.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-07-20 16:18:04.281991902 +0100
+++ 0077-net-virtio-user-fix-leak-when-initialisation-fails.patch	2023-07-20 16:17:54.922751574 +0100
@@ -1 +1 @@
-From c8254ef1a96c4897293b1d1db8c8a786dfb19e9d Mon Sep 17 00:00:00 2001
+From 77145940b5b8c8de00afd24cd3edb45dd095705b Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit c8254ef1a96c4897293b1d1db8c8a786dfb19e9d ]
+
@@ -11 +12,0 @@
-Cc: stable at dpdk.org
@@ -21 +22 @@
-index 2b4607a291..af1f8c8237 100644
+index f9cada05e4..4044774ea0 100644
@@ -24 +25 @@
-@@ -697,9 +697,5 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, uint16_t queues,
+@@ -586,9 +586,5 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues,
@@ -35 +36 @@
-@@ -795,4 +791,5 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, uint16_t queues,
+@@ -663,4 +659,5 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues,
@@ -40 +41 @@
- 
+ }



More information about the stable mailing list