Skip to content

Commit 028c49f

Browse files
committed
USB: serial: quatech2: fix use-after-free in probe error path
The interface read URB is submitted in attach, but was only unlinked by the driver at disconnect. In case of a late probe error (e.g. due to failed minor allocation), disconnect is never called and we would end up with active URBs for an unbound interface. This in turn could lead to deallocated memory being dereferenced in the completion callback. Fixes: f7a33e6 ("USB: serial: add quatech2 usb to serial driver") Cc: stable <stable@vger.kernel.org> # v3.5: 40d0473 Signed-off-by: Johan Hovold <johan@kernel.org> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 9e45284 commit 028c49f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/usb/serial/quatech2.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ static void qt2_release(struct usb_serial *serial)
141141

142142
serial_priv = usb_get_serial_data(serial);
143143

144+
usb_kill_urb(serial_priv->read_urb);
144145
usb_free_urb(serial_priv->read_urb);
145146
kfree(serial_priv->read_buffer);
146147
kfree(serial_priv);

0 commit comments

Comments
 (0)