[dpdk-stable] patch 'vhost: fix fd leak in dirty logging setup' has been queued to LTS release 18.11.11

Kevin Traynor ktraynor at redhat.com
Mon Nov 23 18:12:07 CET 2020


Hi,

FYI, your patch has been queued to LTS release 18.11.11

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/27/20. 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-queue

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable-queue/commit/34ed9a3f953af3ac036f9cf6d14d397b251d3bdb

Thanks.

Kevin.

---
>From 34ed9a3f953af3ac036f9cf6d14d397b251d3bdb Mon Sep 17 00:00:00 2001
From: Maxime Coquelin <maxime.coquelin at redhat.com>
Date: Thu, 12 Nov 2020 18:10:28 +0100
Subject: [PATCH] vhost: fix fd leak in dirty logging setup

[ upstream commit 6dc3f119ce7310e4e473e5759885ac773dbb12ef ]

This patch fixes a file descriptor leak which happens
in the error path of vhost_user_set_log_base().

Fixes: 4796ad63ba1f ("examples/vhost: import userspace vhost application")

Reported-by: Xuan Ding <xuan.ding at intel.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin at redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia at intel.com>
Reviewed-by: Xueming Li <xuemingl at nvidia.com>
---
 lib/librte_vhost/vhost_user.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c
index f35ea97b6a..ca6f8338cc 100644
--- a/lib/librte_vhost/vhost_user.c
+++ b/lib/librte_vhost/vhost_user.c
@@ -1609,5 +1609,5 @@ vhost_user_set_log_base(struct virtio_net **pdev, struct VhostUserMsg *msg,
 			"invalid log base msg size: %"PRId32" != %d\n",
 			msg->size, (int)sizeof(VhostUserLog));
-		return VH_RESULT_ERR;
+		goto close_msg_fds;
 	}
 
@@ -1620,5 +1620,5 @@ vhost_user_set_log_base(struct virtio_net **pdev, struct VhostUserMsg *msg,
 			"log offset %#"PRIx64" and log size %#"PRIx64" overflow\n",
 			off, size);
-		return VH_RESULT_ERR;
+		goto close_msg_fds;
 	}
 
@@ -1657,4 +1657,8 @@ vhost_user_set_log_base(struct virtio_net **pdev, struct VhostUserMsg *msg,
 
 	return VH_RESULT_REPLY;
+
+close_msg_fds:
+	close_msg_fds(msg);
+	return VH_RESULT_ERR;
 }
 
-- 
2.26.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-11-23 17:10:14.351861789 +0000
+++ 0015-vhost-fix-fd-leak-in-dirty-logging-setup.patch	2020-11-23 17:10:13.995061587 +0000
@@ -1 +1 @@
-From 6dc3f119ce7310e4e473e5759885ac773dbb12ef Mon Sep 17 00:00:00 2001
+From 34ed9a3f953af3ac036f9cf6d14d397b251d3bdb Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 6dc3f119ce7310e4e473e5759885ac773dbb12ef ]
+
@@ -10 +11,0 @@
-Cc: stable at dpdk.org
@@ -21 +22 @@
-index 3898c93d1f..23c115f994 100644
+index f35ea97b6a..ca6f8338cc 100644
@@ -24 +25 @@
-@@ -2087,5 +2087,5 @@ vhost_user_set_log_base(struct virtio_net **pdev, struct VhostUserMsg *msg,
+@@ -1609,5 +1609,5 @@ vhost_user_set_log_base(struct virtio_net **pdev, struct VhostUserMsg *msg,
@@ -27 +28 @@
--		return RTE_VHOST_MSG_RESULT_ERR;
+-		return VH_RESULT_ERR;
@@ -31 +32 @@
-@@ -2098,5 +2098,5 @@ vhost_user_set_log_base(struct virtio_net **pdev, struct VhostUserMsg *msg,
+@@ -1620,5 +1620,5 @@ vhost_user_set_log_base(struct virtio_net **pdev, struct VhostUserMsg *msg,
@@ -34 +35 @@
--		return RTE_VHOST_MSG_RESULT_ERR;
+-		return VH_RESULT_ERR;
@@ -38 +39 @@
-@@ -2135,4 +2135,8 @@ vhost_user_set_log_base(struct virtio_net **pdev, struct VhostUserMsg *msg,
+@@ -1657,4 +1657,8 @@ vhost_user_set_log_base(struct virtio_net **pdev, struct VhostUserMsg *msg,
@@ -40 +41 @@
- 	return RTE_VHOST_MSG_RESULT_REPLY;
+ 	return VH_RESULT_REPLY;
@@ -44 +45 @@
-+	return RTE_VHOST_MSG_RESULT_ERR;
++	return VH_RESULT_ERR;



More information about the stable mailing list