]> git.baikalelectronics.ru Git - kernel.git/commit
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, 10 Oct 2019 10:43:18 +0000 (12:43 +0200)
commit8688bafdc4232e084e2c6ee06a006ae4f6cb6d7c
tree178298817b0b9aab6f0328deba1e6f6049abb332
parent29c4f5f51466d89ecdf7d730ad30bf7b09ed51ac
USB: legousbtower: fix use-after-free on release

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: 724d88f166d4 ("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