OSDN Git Service

USB: legousbtower: fix use-after-free on release
authorJohan Hovold <johan@kernel.org>
Wed, 9 Oct 2019 15:38:47 +0000 (17:38 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Oct 2019 20:41:03 +0000 (13:41 -0700)
commita9640a94bb6f40225bd089bea1bd5ed596ed53c5
treeda051fedcac1d5fa9767428bb756f8037a885c4b
parent72ff2f62146267b564da22d2ce01d40635dba41e
USB: legousbtower: fix use-after-free on release

commit 726b55d0e22ca72c69c947af87785c830289ddbc upstream.

The driver was accessing its struct usb_device in its release()
callback without holding a reference. This would lead to a
use-after-free whenever the device was disconnected while the character
device was still open.

Fixes: fef526cae700 ("USB: legousbtower: remove custom debug macro")
Cc: stable <stable@vger.kernel.org> # 3.12
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://lore.kernel.org/r/20191009153848.8664-5-johan@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/misc/legousbtower.c