]> git.baikalelectronics.ru Git - kernel.git/commit
usb: wusbcore: fix deadlock in wusbhc_gtk_rekey
authorThomas Pugliese <thomas.pugliese@gmail.com>
Mon, 2 Dec 2013 21:39:45 +0000 (15:39 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 2 Dec 2013 23:21:04 +0000 (15:21 -0800)
commitf03d1e09d662b09ecce4984f6c1a81efa6622429
tree407fba0caeb3d553f86c8de029a9f34da39e03d1
parenteb8d4a25176ab5ee41ecf70c6ec9b67745765b8d
usb: wusbcore: fix deadlock in wusbhc_gtk_rekey

When multiple wireless USB devices are connected and one of the devices
disconnects, the host will distribute a new group key to the remaining
devicese using wusbhc_gtk_rekey.  wusbhc_gtk_rekey takes the
wusbhc->mutex and holds it while it submits a URB to set the new key.
This causes a deadlock in wa_urb_enqueue when it calls a device lookup
helper function that takes the same lock.

This patch changes wusbhc_gtk_rekey to submit a work item to set the GTK
so that the URB is submitted without holding wusbhc->mutex.

Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/wusbcore/devconnect.c
drivers/usb/wusbcore/security.c
drivers/usb/wusbcore/wusbhc.h
include/linux/usb/wusb.h