From: Greg Kroah-Hartman Date: Fri, 21 Apr 2017 15:17:16 +0000 (+0200) Subject: 4.4-stable patches X-Git-Tag: v3.18.50~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3063890c0b011d60ed0345fcc01dc666d27f6041;p=thirdparty%2Fkernel%2Fstable-queue.git 4.4-stable patches added patches: drivers-hv-don-t-leak-memory-in-vmbus_establish_gpadl.patch drivers-hv-get-rid-of-timeout-in-vmbus_open.patch drivers-hv-vmbus-reduce-the-delay-between-retries-in-vmbus_post_msg.patch vsock-detach-qp-check-should-filter-out-non-matching-qps.patch --- diff --git a/queue-4.4/drivers-hv-don-t-leak-memory-in-vmbus_establish_gpadl.patch b/queue-4.4/drivers-hv-don-t-leak-memory-in-vmbus_establish_gpadl.patch new file mode 100644 index 00000000000..4b35a267c47 --- /dev/null +++ b/queue-4.4/drivers-hv-don-t-leak-memory-in-vmbus_establish_gpadl.patch @@ -0,0 +1,52 @@ +From 7cc80c98070ccc7940fc28811c92cca0a681015d Mon Sep 17 00:00:00 2001 +From: Vitaly Kuznetsov +Date: Fri, 3 Jun 2016 17:09:24 -0700 +Subject: Drivers: hv: don't leak memory in vmbus_establish_gpadl() + +From: Vitaly Kuznetsov + +commit 7cc80c98070ccc7940fc28811c92cca0a681015d upstream. + +In some cases create_gpadl_header() allocates submessages but we never +free them. + +[sumits] Note for stable: +Upstream commit 4d63763296ab7865a98bc29cc7d77145815ef89f: +(Drivers: hv: get rid of redundant messagecount in create_gpadl_header()) +changes the list usage to initialize list header in all cases; that patch +isn't added to stable, so the current patch is modified a little bit from +the upstream commit to check if the list is valid or not. + +Signed-off-by: Vitaly Kuznetsov +Signed-off-by: K. Y. Srinivasan +Signed-off-by: Sumit Semwal +Signed-off-by: Greg Kroah-Hartman +--- + drivers/hv/channel.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +--- a/drivers/hv/channel.c ++++ b/drivers/hv/channel.c +@@ -375,7 +375,7 @@ int vmbus_establish_gpadl(struct vmbus_c + struct vmbus_channel_gpadl_header *gpadlmsg; + struct vmbus_channel_gpadl_body *gpadl_body; + struct vmbus_channel_msginfo *msginfo = NULL; +- struct vmbus_channel_msginfo *submsginfo; ++ struct vmbus_channel_msginfo *submsginfo, *tmp; + u32 msgcount; + struct list_head *curr; + u32 next_gpadl_handle; +@@ -437,6 +437,13 @@ cleanup: + list_del(&msginfo->msglistentry); + spin_unlock_irqrestore(&vmbus_connection.channelmsg_lock, flags); + ++ if (msgcount > 1) { ++ list_for_each_entry_safe(submsginfo, tmp, &msginfo->submsglist, ++ msglistentry) { ++ kfree(submsginfo); ++ } ++ } ++ + kfree(msginfo); + return ret; + } diff --git a/queue-4.4/drivers-hv-get-rid-of-timeout-in-vmbus_open.patch b/queue-4.4/drivers-hv-get-rid-of-timeout-in-vmbus_open.patch new file mode 100644 index 00000000000..d2b1544d9c2 --- /dev/null +++ b/queue-4.4/drivers-hv-get-rid-of-timeout-in-vmbus_open.patch @@ -0,0 +1,47 @@ +From 396e287fa2ff46e83ae016cdcb300c3faa3b02f6 Mon Sep 17 00:00:00 2001 +From: Vitaly Kuznetsov +Date: Thu, 9 Jun 2016 17:08:56 -0700 +Subject: Drivers: hv: get rid of timeout in vmbus_open() + +From: Vitaly Kuznetsov + +commit 396e287fa2ff46e83ae016cdcb300c3faa3b02f6 upstream. + +vmbus_teardown_gpadl() can result in infinite wait when it is called on 5 +second timeout in vmbus_open(). The issue is caused by the fact that gpadl +teardown operation won't ever succeed for an opened channel and the timeout +isn't always enough. As a guest, we can always trust the host to respond to +our request (and there is nothing we can do if it doesn't). + +Signed-off-by: Vitaly Kuznetsov +Signed-off-by: K. Y. Srinivasan +Signed-off-by: Sumit Semwal +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/hv/channel.c | 7 +------ + 1 file changed, 1 insertion(+), 6 deletions(-) + +--- a/drivers/hv/channel.c ++++ b/drivers/hv/channel.c +@@ -73,7 +73,6 @@ int vmbus_open(struct vmbus_channel *new + void *in, *out; + unsigned long flags; + int ret, err = 0; +- unsigned long t; + struct page *page; + + spin_lock_irqsave(&newchannel->lock, flags); +@@ -183,11 +182,7 @@ int vmbus_open(struct vmbus_channel *new + goto error1; + } + +- t = wait_for_completion_timeout(&open_info->waitevent, 5*HZ); +- if (t == 0) { +- err = -ETIMEDOUT; +- goto error1; +- } ++ wait_for_completion(&open_info->waitevent); + + spin_lock_irqsave(&vmbus_connection.channelmsg_lock, flags); + list_del(&open_info->msglistentry); diff --git a/queue-4.4/drivers-hv-vmbus-reduce-the-delay-between-retries-in-vmbus_post_msg.patch b/queue-4.4/drivers-hv-vmbus-reduce-the-delay-between-retries-in-vmbus_post_msg.patch new file mode 100644 index 00000000000..ce3d34b3809 --- /dev/null +++ b/queue-4.4/drivers-hv-vmbus-reduce-the-delay-between-retries-in-vmbus_post_msg.patch @@ -0,0 +1,44 @@ +From 8de0d7e951826d7592e0ba1da655b175c4aa0923 Mon Sep 17 00:00:00 2001 +From: "K. Y. Srinivasan" +Date: Fri, 1 Jul 2016 16:26:36 -0700 +Subject: Drivers: hv: vmbus: Reduce the delay between retries in vmbus_post_msg() + +From: K. Y. Srinivasan + +commit 8de0d7e951826d7592e0ba1da655b175c4aa0923 upstream. + +The current delay between retries is unnecessarily high and is negatively +affecting the time it takes to boot the system. + +Signed-off-by: K. Y. Srinivasan +Signed-off-by: Sumit Semwal +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/hv/connection.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +--- a/drivers/hv/connection.c ++++ b/drivers/hv/connection.c +@@ -429,7 +429,7 @@ int vmbus_post_msg(void *buffer, size_t + union hv_connection_id conn_id; + int ret = 0; + int retries = 0; +- u32 msec = 1; ++ u32 usec = 1; + + conn_id.asu32 = 0; + conn_id.u.id = VMBUS_MESSAGE_CONNECTION_ID; +@@ -462,9 +462,9 @@ int vmbus_post_msg(void *buffer, size_t + } + + retries++; +- msleep(msec); +- if (msec < 2048) +- msec *= 2; ++ udelay(usec); ++ if (usec < 2048) ++ usec *= 2; + } + return ret; + } diff --git a/queue-4.4/series b/queue-4.4/series index 50191f16a48..b5fb7186d8b 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -6,3 +6,7 @@ ring-buffer-have-ring_buffer_iter_empty-return-true-when-empty.patch cifs-do-not-send-echoes-before-negotiate-is-complete.patch cifs-remove-bad_network_name-flag.patch s390-mm-fix-cmma-vs-ksm-vs-others.patch +drivers-hv-don-t-leak-memory-in-vmbus_establish_gpadl.patch +drivers-hv-get-rid-of-timeout-in-vmbus_open.patch +drivers-hv-vmbus-reduce-the-delay-between-retries-in-vmbus_post_msg.patch +vsock-detach-qp-check-should-filter-out-non-matching-qps.patch diff --git a/queue-4.4/vsock-detach-qp-check-should-filter-out-non-matching-qps.patch b/queue-4.4/vsock-detach-qp-check-should-filter-out-non-matching-qps.patch new file mode 100644 index 00000000000..05a5e1078cd --- /dev/null +++ b/queue-4.4/vsock-detach-qp-check-should-filter-out-non-matching-qps.patch @@ -0,0 +1,45 @@ +From 8ab18d71de8b07d2c4d6f984b718418c09ea45c5 Mon Sep 17 00:00:00 2001 +From: Jorgen Hansen +Date: Tue, 5 Apr 2016 01:59:32 -0700 +Subject: VSOCK: Detach QP check should filter out non matching QPs. + +From: Jorgen Hansen + +commit 8ab18d71de8b07d2c4d6f984b718418c09ea45c5 upstream. + +The check in vmci_transport_peer_detach_cb should only allow a +detach when the qp handle of the transport matches the one in +the detach message. + +Testing: Before this change, a detach from a peer on a different +socket would cause an active stream socket to register a detach. + +Reviewed-by: George Zhang +Signed-off-by: Jorgen Hansen +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman + +--- + net/vmw_vsock/vmci_transport.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/net/vmw_vsock/vmci_transport.c ++++ b/net/vmw_vsock/vmci_transport.c +@@ -842,7 +842,7 @@ static void vmci_transport_peer_detach_c + * qp_handle. + */ + if (vmci_handle_is_invalid(e_payload->handle) || +- vmci_handle_is_equal(trans->qp_handle, e_payload->handle)) ++ !vmci_handle_is_equal(trans->qp_handle, e_payload->handle)) + return; + + /* We don't ask for delayed CBs when we subscribe to this event (we +@@ -2154,7 +2154,7 @@ module_exit(vmci_transport_exit); + + MODULE_AUTHOR("VMware, Inc."); + MODULE_DESCRIPTION("VMCI transport for Virtual Sockets"); +-MODULE_VERSION("1.0.2.0-k"); ++MODULE_VERSION("1.0.3.0-k"); + MODULE_LICENSE("GPL v2"); + MODULE_ALIAS("vmware_vsock"); + MODULE_ALIAS_NETPROTO(PF_VSOCK);