lkml.org 
[lkml]   [2017]   [Oct]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.13 117/160] vmbus: dont acquire the mutex in vmbus_hvsock_device_unregister()
    Date
    4.13-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Dexuan Cui <decui@microsoft.com>

    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.

    Signed-off-by: Dexuan Cui <decui@microsoft.com>
    Cc: K. Y. Srinivasan <kys@microsoft.com>
    Cc: Haiyang Zhang <haiyangz@microsoft.com>
    Cc: Stephen Hemminger <sthemmin@microsoft.com>
    Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    ---
    drivers/hv/channel_mgmt.c | 4 ----
    1 file changed, 4 deletions(-)

    --- a/drivers/hv/channel_mgmt.c
    +++ b/drivers/hv/channel_mgmt.c
    @@ -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);


    \
     
     \ /
      Last update: 2017-10-10 22:18    [W:2.115 / U:0.024 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site