This is a note to let you know that I've just added the patch titled USB: serial: mos7720: fix use-after-free on probe errors to the 4.9-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: usb-serial-mos7720-fix-use-after-free-on-probe-errors.patch and it can be found in the queue-4.9 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 91a1ff4d53c5184d383d0baeeaeab6f9736f2ff3 Mon Sep 17 00:00:00 2001 From: Johan Hovold <johan@xxxxxxxxxx> Date: Tue, 3 Jan 2017 16:39:51 +0100 Subject: USB: serial: mos7720: fix use-after-free on probe errors From: Johan Hovold <johan@xxxxxxxxxx> commit 91a1ff4d53c5184d383d0baeeaeab6f9736f2ff3 upstream. The interrupt URB was submitted on probe but never stopped on probe errors. This can lead to use-after-free issues in the completion handler when accessing the freed usb-serial struct: Unable to handle kernel paging request at virtual address 6b6b6be7 ... [<bf052e70>] (mos7715_interrupt_callback [mos7720]) from [<c052a894>] (__usb_hcd_giveback_urb+0x80/0x140) [<c052a894>] (__usb_hcd_giveback_urb) from [<c052a9a4>] (usb_hcd_giveback_urb+0x50/0x138) [<c052a9a4>] (usb_hcd_giveback_urb) from [<c0550684>] (musb_giveback+0xc8/0x1cc) Fixes: b69578df7e98 ("USB: usbserial: mos7720: add support for parallel port on moschip 7715") Signed-off-by: Johan Hovold <johan@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/usb/serial/mos7720.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) --- a/drivers/usb/serial/mos7720.c +++ b/drivers/usb/serial/mos7720.c @@ -1965,8 +1965,10 @@ static int mos7720_startup(struct usb_se #ifdef CONFIG_USB_SERIAL_MOS7715_PARPORT if (product == MOSCHIP_DEVICE_ID_7715) { ret_val = mos7715_parport_init(serial); - if (ret_val < 0) + if (ret_val < 0) { + usb_kill_urb(serial->port[0]->interrupt_in_urb); return ret_val; + } } #endif /* LSR For Port 1 */ @@ -1978,6 +1980,8 @@ static int mos7720_startup(struct usb_se static void mos7720_release(struct usb_serial *serial) { + usb_kill_urb(serial->port[0]->interrupt_in_urb); + #ifdef CONFIG_USB_SERIAL_MOS7715_PARPORT /* close the parallel port */ Patches currently in stable-queue which might be from johan@xxxxxxxxxx are queue-4.9/usb-serial-io_ti-fix-i-o-after-disconnect.patch queue-4.9/usb-serial-ti_usb_3410_5052-fix-null-deref-at-open.patch queue-4.9/usb-serial-kobil_sct-fix-null-deref-in-write.patch queue-4.9/usb-serial-spcp8x5-fix-null-deref-at-open.patch queue-4.9/usb-serial-mos7720-fix-parallel-probe.patch queue-4.9/usb-serial-cyberjack-fix-null-deref-at-open.patch queue-4.9/usb-serial-mos7720-fix-null-deref-at-open.patch queue-4.9/usb-serial-garmin_gps-fix-memory-leak-on-failed-urb-submit.patch queue-4.9/usb-serial-io_ti-fix-null-deref-at-open.patch queue-4.9/usb-serial-pl2303-fix-null-deref-at-open.patch queue-4.9/usb-serial-quatech2-fix-sleep-while-atomic-in-close.patch queue-4.9/usb-serial-iuu_phoenix-fix-null-deref-at-open.patch queue-4.9/usb-serial-oti6858-fix-null-deref-at-open.patch queue-4.9/usb-serial-io_edgeport-fix-null-deref-at-open.patch queue-4.9/usb-serial-mos7720-fix-parport-use-after-free-on-probe-errors.patch queue-4.9/usb-serial-mos7720-fix-use-after-free-on-probe-errors.patch queue-4.9/usb-serial-mos7840-fix-null-deref-at-open.patch queue-4.9/usb-serial-omninet-fix-null-derefs-at-open-and-disconnect.patch queue-4.9/usb-serial-keyspan_pda-verify-endpoints-at-probe.patch queue-4.9/usb-serial-io_ti-fix-another-null-deref-at-open.patch -- To unsubscribe from this list: send the line "unsubscribe stable" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html