]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
USB: serial: console: fix use-after-free on disconnect
authorJohan Hovold <johan@kernel.org>
Wed, 4 Oct 2017 09:01:12 +0000 (11:01 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Oct 2017 07:38:32 +0000 (09:38 +0200)
commit6c7cb458405ecec07f2ae578af028af5dd62ba2e
tree2ee9134955f5f3e773796be8d0ee01f9caceb8b9
parent4b3e3c7282d6569d57ae35e923d1c29581e98215
USB: serial: console: fix use-after-free on disconnect

commit bd998c2e0df0469707503023d50d46cf0b10c787 upstream.

A clean-up patch removing two redundant NULL-checks from the console
disconnect handler inadvertently also removed a third check. This could
lead to the struct usb_serial being prematurely freed by the console
code when a driver accepts but does not register any ports for an
interface which also lacks endpoint descriptors.

Fixes: 0e517c93dc02 ("USB: serial: console: clean up sanity checks")
Reported-by: Andrey Konovalov <andreyknvl@google.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/serial/console.c