USB: console: fix potential use after free
authorJohan Hovold <johan@kernel.org>
Mon, 5 Jan 2015 15:04:13 +0000 (16:04 +0100)
committerJohan Hovold <johan@kernel.org>
Sat, 10 Jan 2015 11:48:21 +0000 (12:48 +0100)
commit32a4bf2e81ec378e5925d4e069e0677a6c86a6ad
tree7060d862f8df27bd46007e6d30ac38ca2e8eafa2
parentd269d4434c72ed0da3a9b1230c30da82c4918c63
USB: console: fix potential use after free

Use tty kref to release the fake tty in usb_console_setup to avoid use
after free if the underlying serial driver has acquired a reference.

Note that using the tty destructor release_one_tty requires some more
state to be initialised.

Fixes: 4a90f09b20f4 ("tty: usb-serial krefs")
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
drivers/usb/serial/console.c