]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
USB: usblcd: fix I/O after disconnect
authorJohan Hovold <johan@kernel.org>
Thu, 26 Sep 2019 09:12:25 +0000 (11:12 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 12 Nov 2019 18:04:34 +0000 (19:04 +0100)
commit372efcf72564df60e1dd71b86528f6d6cd4f8387
tree483f177a8b864a26727babad1aa419339b40062b
parent69ca674eb605c673b238765e2e19e894c9d2854b
USB: usblcd: fix I/O after disconnect

BugLink: https://bugs.launchpad.net/bugs/1850541
commit eb7f5a490c5edfe8126f64bc58b9ba2edef0a425 upstream.

Make sure to stop all I/O on disconnect by adding a disconnected flag
which is used to prevent new I/O from being started and by stopping all
ongoing I/O before returning.

This also fixes a potential use-after-free on driver unbind in case the
driver data is freed before the completion handler has run.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Cc: stable <stable@vger.kernel.org> # 7bbe990c989e
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://lore.kernel.org/r/20190926091228.24634-7-johan@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/usb/misc/usblcd.c