[dpdk-stable] patch 'vhost: fix fd leak in dirty logging setup' has been queued to stable release 19.11.6
luca.boccassi at gmail.com
luca.boccassi at gmail.com
Tue Nov 17 12:14:03 CET 2020
Hi,
FYI, your patch has been queued to stable release 19.11.6
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/19/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/bluca/dpdk-stable
This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/98e192abb017789d216e138dd6e6f09548b5e24a
Thanks.
Luca Boccassi
---
>From 98e192abb017789d216e138dd6e6f09548b5e24a 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 f8366c9be2..4647ba64f0 100644
--- a/lib/librte_vhost/vhost_user.c
+++ b/lib/librte_vhost/vhost_user.c
@@ -2088,7 +2088,7 @@ vhost_user_set_log_base(struct virtio_net **pdev, struct VhostUserMsg *msg,
RTE_LOG(ERR, VHOST_CONFIG,
"invalid log base msg size: %"PRId32" != %d\n",
msg->size, (int)sizeof(VhostUserLog));
- return RTE_VHOST_MSG_RESULT_ERR;
+ goto close_msg_fds;
}
size = msg->payload.log.mmap_size;
@@ -2099,7 +2099,7 @@ vhost_user_set_log_base(struct virtio_net **pdev, struct VhostUserMsg *msg,
RTE_LOG(ERR, VHOST_CONFIG,
"log offset %#"PRIx64" and log size %#"PRIx64" overflow\n",
off, size);
- return RTE_VHOST_MSG_RESULT_ERR;
+ goto close_msg_fds;
}
RTE_LOG(INFO, VHOST_CONFIG,
@@ -2136,6 +2136,10 @@ vhost_user_set_log_base(struct virtio_net **pdev, struct VhostUserMsg *msg,
msg->fd_num = 0;
return RTE_VHOST_MSG_RESULT_REPLY;
+
+close_msg_fds:
+ close_msg_fds(msg);
+ return RTE_VHOST_MSG_RESULT_ERR;
}
static int vhost_user_set_log_fd(struct virtio_net **pdev __rte_unused,
--
2.27.0
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2020-11-17 11:13:14.210330472 +0000
+++ 0029-vhost-fix-fd-leak-in-dirty-logging-setup.patch 2020-11-17 11:13:12.937116931 +0000
@@ -1 +1 @@
-From 6dc3f119ce7310e4e473e5759885ac773dbb12ef Mon Sep 17 00:00:00 2001
+From 98e192abb017789d216e138dd6e6f09548b5e24a 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 f8366c9be2..4647ba64f0 100644
@@ -24,2 +25,2 @@
-@@ -2086,7 +2086,7 @@ vhost_user_set_log_base(struct virtio_net **pdev, struct VhostUserMsg *msg,
- VHOST_LOG_CONFIG(ERR,
+@@ -2088,7 +2088,7 @@ vhost_user_set_log_base(struct virtio_net **pdev, struct VhostUserMsg *msg,
+ RTE_LOG(ERR, VHOST_CONFIG,
@@ -33,2 +34,2 @@
-@@ -2097,7 +2097,7 @@ vhost_user_set_log_base(struct virtio_net **pdev, struct VhostUserMsg *msg,
- VHOST_LOG_CONFIG(ERR,
+@@ -2099,7 +2099,7 @@ vhost_user_set_log_base(struct virtio_net **pdev, struct VhostUserMsg *msg,
+ RTE_LOG(ERR, VHOST_CONFIG,
@@ -41,2 +42,2 @@
- VHOST_LOG_CONFIG(INFO,
-@@ -2134,6 +2134,10 @@ vhost_user_set_log_base(struct virtio_net **pdev, struct VhostUserMsg *msg,
+ RTE_LOG(INFO, VHOST_CONFIG,
+@@ -2136,6 +2136,10 @@ vhost_user_set_log_base(struct virtio_net **pdev, struct VhostUserMsg *msg,
More information about the stable
mailing list