Skip to contentSkip to conversation

Patch "vmbus: don't acquire the mutex in vmbus_hvsock_device_unregister()" has been added to the 4.13-stable tree

PATCH [email protected] 1 participant 1 message Oct 10, 2017

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

vmbus: don't acquire the mutex in vmbus_hvsock_device_unregister()

to the 4.13-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
vmbus-don-t-acquire-the-mutex-in-vmbus_hvsock_device_unregister.patch
and it can be found in the queue-4.13 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From 33c150c2ee4a65a59190a124b45d05b1abf9478e Mon Sep 17 00:00:00 2001

From: Dexuan Cui <[email protected]>
Date: Thu, 21 Sep 2017 23:41:47 -0700
Subject: vmbus: don't acquire the mutex in vmbus_hvsock_device_unregister()

From: Dexuan Cui <[email protected]>

commit 33c150c2ee4a65a59190a124b45d05b1abf9478e upstream.

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.

---
 drivers/hv/channel_mgmt.c |    4 ----
 1 file changed, 4 deletions(-)
drivers/hv/channel_mgmt.c +0 -4
@@ -922,14 +922,10 @@ static void vmbus_onoffer_rescind(struct
 
 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);
 

Patches currently in stable-queue which might be from [email protected] are

queue-4.13/vmbus-don-t-acquire-the-mutex-in-vmbus_hvsock_device_unregister.patch