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

commit 299d7572e46f98534033a9e65973f13ad1ce9047 upstream.

Make sure to reset the USB-console port pointer when console setup fails
in order to avoid having the struct usb_serial be prematurely freed by
the console code when the device is later disconnected.

Fixes: 73e487fdb75f ("[PATCH] USB console: fix disconnection issues")
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