Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751890AbdIVGmx (ORCPT ); Fri, 22 Sep 2017 02:42:53 -0400 Received: from a2nlsmtp01-04.prod.iad2.secureserver.net ([198.71.225.38]:33396 "EHLO a2nlsmtp01-04.prod.iad2.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751637AbdIVGmv (ORCPT ); Fri, 22 Sep 2017 02:42:51 -0400 x-originating-ip: 107.180.71.197 From: kys@exchange.microsoft.com To: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, devel@linuxdriverproject.org, olaf@aepfle.de, apw@canonical.com, vkuznets@redhat.com, jasowang@redhat.com, leann.ogasawara@canonical.com, marcelo.cerri@canonical.com, sthemmin@microsoft.com Cc: Dexuan Cui , "K . Y . Srinivasan" , Haiyang Zhang , stable@vger.kernel.org (4.13 and above) Subject: [PATCH 1/2] vmbus: don't acquire the mutex in vmbus_hvsock_device_unregister() Date: Thu, 21 Sep 2017 23:41:47 -0700 Message-Id: <20170922064148.10517-1-kys@exchange.microsoft.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20170922064029.10459-1-kys@exchange.microsoft.com> References: <20170922064029.10459-1-kys@exchange.microsoft.com> Reply-To: kys@microsoft.com X-CMAE-Envelope: MS4wfOu6/kwCQkb7+MYnl3qF2RcCPZFgddaLJJ10ilz5qqA5ebsLHhglEz+lTS/YTYg9CstdZcA9HIxieJMVJzyJCa7tAcDh6WuJKS5otBFEvLV5ffp9gzi0 8NyltMmSsNm9P1M0Dha8ta64qeuz1m7bH6KPAIU/ORuk6mXHYQwYOclFrmBdZW/AqYaf+BhlwKH/Fjmh/Iq0x9PLu1WENLPJG4zKtX3TGDbdB96i1vERWBaR 8E1aJUehb0Ejw2zeujdD3P87MFXUIUjOL2/KBkUg37KPB8Xg3n1rKcZOC27ChazZ1crcX6U5QdrDu+xc2q6A0aI2t2I5NSGaT8JaFnmA9l5OscOVAeng3jWD w267+/7/7DYVnUYe4qOOLuOTIFuRo5gmoUSIWjIMacZQG7y1PxH1lfc1+9UpENrj+9/C22KSk/ITuELDR85SYjEeqvZ1xrPeJWndDd+d3WG/41rScpKcfMlw LkBOUKyyF4JOQar0RXUVdAUN5hglN2fg8VoWjudaSRMFufMJ9O3IoyrUFoEbf3vcm3e9SCKC5P+tp5dmcRCvzFGa1ZV1uXMwNgkz77vTMPZfzG8PcRS1CtQI ylESA5Bm+cOGIbgIwcLbEQW1yswajsag6A1DCeUP3DHJUQ== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1392 Lines: 41 From: Dexuan Cui Due to commit 54a66265d675 ("Drivers: hv: vmbus: Fix rescind handling"), we need this patch to resolve the below deadlock: after we get the mutex in vmbus_hvsock_device_unregister() and call vmbus_device_unregister() -> device_unregister() -> ... -> device_release() -> vmbus_device_release(), we'll get a deadlock, because vmbus_device_release() tries to get the same mutex. Signed-off-by: Dexuan Cui Cc: K. Y. Srinivasan Cc: Haiyang Zhang Cc: Stephen Hemminger Signed-off-by: K. Y. Srinivasan Cc: stable@vger.kernel.org (4.13 and above) --- drivers/hv/channel_mgmt.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c index 968af173c4c1..624d815745e4 100644 --- a/drivers/hv/channel_mgmt.c +++ b/drivers/hv/channel_mgmt.c @@ -945,14 +945,10 @@ static void vmbus_onoffer_rescind(struct vmbus_channel_message_header *hdr) void vmbus_hvsock_device_unregister(struct vmbus_channel *channel) { - mutex_lock(&vmbus_connection.channel_mutex); - BUG_ON(!is_hvsock_channel(channel)); channel->rescind = true; vmbus_device_unregister(channel->device_obj); - - mutex_unlock(&vmbus_connection.channel_mutex); } EXPORT_SYMBOL_GPL(vmbus_hvsock_device_unregister); -- 2.14.1