usb: iowarrior: fix deadlock on disconnect
authorOliver Neukum <oneukum@suse.com>
Thu, 8 Aug 2019 09:27:28 +0000 (11:27 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 8 Aug 2019 10:43:18 +0000 (12:43 +0200)
commitc468a8aa790e0dfe0a7f8a39db282d39c2c00b46
treec240fe5ca5814296dad9065896cc1f315b8b642c
parent2ca359f4f8b954b3a9d15a89f22a8b7283e7669f
usb: iowarrior: fix deadlock on disconnect

We have to drop the mutex before we close() upon disconnect()
as close() needs the lock. This is safe to do by dropping the
mutex as intfdata is already set to NULL, so open() will fail.

Fixes: 03f36e885fc26 ("USB: open disconnect race in iowarrior")
Reported-by: syzbot+a64a382964bf6c71a9c0@syzkaller.appspotmail.com
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Oliver Neukum <oneukum@suse.com>
Link: https://lore.kernel.org/r/20190808092728.23417-1-oneukum@suse.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/misc/iowarrior.c