]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
USB: serial: mos7720: fix use-after-free on probe errors
authorJohan Hovold <johan@kernel.org>
Tue, 3 Jan 2017 15:39:51 +0000 (16:39 +0100)
committerLuis Henriques <luis.henriques@canonical.com>
Fri, 20 Jan 2017 11:26:37 +0000 (11:26 +0000)
commitb51c4b2af2c57472f49bc818bc8ab341327e7828
tree116cd1bd399c29d319a117e3fb96393072f299bd
parentdad540d105f6f66d2f58433f9ff4ecc369a13f79
USB: serial: mos7720: fix use-after-free on probe errors

BugLink: http://bugs.launchpad.net/bugs/1655969
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@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
drivers/usb/serial/mos7720.c