Skip to contentSkip to conversation

patch "USB: serial: console: fix use-after-free after failed setup" added to usb-linus

PATCH [email protected] 1 participant 1 message Oct 9, 2017

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

USB: serial: console: fix use-after-free after failed setup

to my usb git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
in the usb-linus branch.

The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.)

The patch will hopefully also be merged in Linus's tree for the next -rc kernel release.

If you have any questions about this process, please let me know.

Quoted 1 line

From 299d7572e46f98534033a9e65973f13ad1ce9047 Mon Sep 17 00:00:00 2001

From: Johan Hovold <[email protected]>
Date: Wed, 4 Oct 2017 11:01:13 +0200
Subject: USB: serial: console: fix use-after-free after failed setup

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")
Cc stable <[email protected]> # 2.6.18
---
 drivers/usb/serial/console.c | 1 +
 1 file changed, 1 insertion(+)
drivers/usb/serial/console.c +1 -0
index ed8ba3ef5c79..43a862a90a77 100644
@@ -186,6 +186,7 @@ static int usb_console_setup(struct console *co, char *options)
 	tty_kref_put(tty);
  reset_open_count:
 	port->port.count = 0;
+	info->port = NULL;
 	usb_autopm_put_interface(serial->interface);
  error_get_interface:
 	usb_serial_put(serial);
Signature · 1 line
2.14.2