[dpdk-stable] patch 'vhost: fix device leak on connection add failure' has been queued to LTS release 17.11.7
Yongseok Koh
yskoh at mellanox.com
Tue Jul 23 03:00:51 CEST 2019
Hi,
FYI, your patch has been queued to LTS release 17.11.7
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objection by 07/27/19. So please
shout if anyone has objection.
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.
Thanks.
Yongseok
---
>From 97e6c612b762e72ff6e33d5a2e310851cf1030a7 Mon Sep 17 00:00:00 2001
From: Ilya Maximets <i.maximets at samsung.com>
Date: Thu, 11 Apr 2019 13:23:06 +0300
Subject: [PATCH] vhost: fix device leak on connection add failure
[ upstream commit a21510e750430914a5638a8925e87609a32cbbff ]
Need to destroy allocated device if application fails to
add new connection or we have fdset failure.
Fixes: acbff5c67ea7 ("vhost: fix crash when exceeding file descriptors")
Fixes: efba12a78ddf ("vhost: add user callbacks for socket open/close")
Reported-by: David Marchand <david.marchand at redhat.com>
Signed-off-by: Ilya Maximets <i.maximets at samsung.com>
Reviewed-by: David Marchand <david.marchand at redhat.com>
Reviewed-by: Jens Freimann <jfreimann at redhat.com>
Reviewed-by: Tiwei Bie <tiwei.bie at intel.com>
---
lib/librte_vhost/socket.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/lib/librte_vhost/socket.c b/lib/librte_vhost/socket.c
index a3fd3dc23d..88be697c2f 100644
--- a/lib/librte_vhost/socket.c
+++ b/lib/librte_vhost/socket.c
@@ -241,7 +241,7 @@ vhost_user_add_connection(int fd, struct vhost_user_socket *vsocket)
RTE_LOG(ERR, VHOST_CONFIG,
"failed to add vhost user connection with fd %d\n",
fd);
- goto err;
+ goto err_cleanup;
}
}
@@ -258,7 +258,7 @@ vhost_user_add_connection(int fd, struct vhost_user_socket *vsocket)
if (vsocket->notify_ops->destroy_connection)
vsocket->notify_ops->destroy_connection(conn->vid);
- goto err;
+ goto err_cleanup;
}
pthread_mutex_lock(&vsocket->conn_mutex);
@@ -266,6 +266,8 @@ vhost_user_add_connection(int fd, struct vhost_user_socket *vsocket)
pthread_mutex_unlock(&vsocket->conn_mutex);
return;
+err_cleanup:
+ vhost_destroy_device(vid);
err:
free(conn);
close(fd);
--
2.21.0
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2019-07-22 17:55:11.011245623 -0700
+++ 0084-vhost-fix-device-leak-on-connection-add-failure.patch 2019-07-22 17:55:06.392476000 -0700
@@ -1,14 +1,15 @@
-From a21510e750430914a5638a8925e87609a32cbbff Mon Sep 17 00:00:00 2001
+From 97e6c612b762e72ff6e33d5a2e310851cf1030a7 Mon Sep 17 00:00:00 2001
From: Ilya Maximets <i.maximets at samsung.com>
Date: Thu, 11 Apr 2019 13:23:06 +0300
Subject: [PATCH] vhost: fix device leak on connection add failure
+[ upstream commit a21510e750430914a5638a8925e87609a32cbbff ]
+
Need to destroy allocated device if application fails to
add new connection or we have fdset failure.
Fixes: acbff5c67ea7 ("vhost: fix crash when exceeding file descriptors")
Fixes: efba12a78ddf ("vhost: add user callbacks for socket open/close")
-Cc: stable at dpdk.org
Reported-by: David Marchand <david.marchand at redhat.com>
Signed-off-by: Ilya Maximets <i.maximets at samsung.com>
@@ -20,10 +21,10 @@
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/lib/librte_vhost/socket.c b/lib/librte_vhost/socket.c
-index 3da9de62c4..f0fdb83f7d 100644
+index a3fd3dc23d..88be697c2f 100644
--- a/lib/librte_vhost/socket.c
+++ b/lib/librte_vhost/socket.c
-@@ -240,7 +240,7 @@ vhost_user_add_connection(int fd, struct vhost_user_socket *vsocket)
+@@ -241,7 +241,7 @@ vhost_user_add_connection(int fd, struct vhost_user_socket *vsocket)
RTE_LOG(ERR, VHOST_CONFIG,
"failed to add vhost user connection with fd %d\n",
fd);
@@ -32,7 +33,7 @@
}
}
-@@ -257,7 +257,7 @@ vhost_user_add_connection(int fd, struct vhost_user_socket *vsocket)
+@@ -258,7 +258,7 @@ vhost_user_add_connection(int fd, struct vhost_user_socket *vsocket)
if (vsocket->notify_ops->destroy_connection)
vsocket->notify_ops->destroy_connection(conn->vid);
@@ -41,8 +42,8 @@
}
pthread_mutex_lock(&vsocket->conn_mutex);
-@@ -267,6 +267,8 @@ vhost_user_add_connection(int fd, struct vhost_user_socket *vsocket)
- fdset_pipe_notify(&vhost_user.fdset);
+@@ -266,6 +266,8 @@ vhost_user_add_connection(int fd, struct vhost_user_socket *vsocket)
+ pthread_mutex_unlock(&vsocket->conn_mutex);
return;
+err_cleanup:
More information about the stable
mailing list