Skip to content
Commit b1c95308 authored by Johan Hovold's avatar Johan Hovold Committed by Paul Gortmaker
Browse files

USB: legousbtower: fix deadlock on disconnect



commit 33a78132 upstream.

Fix a potential deadlock if disconnect races with open.

Since commit d4ead16f ("USB: prevent char device open/deregister
race") core holds an rw-semaphore while open is called and when
releasing the minor number during deregistration. This can lead to an
ABBA deadlock if a driver takes a lock in open which it also holds
during deregistration.

This effectively reverts commit 78663ecc ("USB: disconnect open race
in legousbtower") which needlessly introduced this issue after a generic
fix for this race had been added to core by commit d4ead16f ("USB:
prevent char device open/deregister race").

Fixes: 78663ecc ("USB: disconnect open race in legousbtower")
Cc: stable <stable@vger.kernel.org>	# 2.6.24
Reported-by: default avatar <syzbot+f9549f5ee8a5416f0b95@syzkaller.appspotmail.com>
Tested-by: default avatar <syzbot+f9549f5ee8a5416f0b95@syzkaller.appspotmail.com>
Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
Link: https://lore.kernel.org/r/20190919083039.30898-3-johan@kernel.org


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
parent 0d7afcc3
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment