Skip to content

Commit

Permalink
USB: serial: keyspan_pda: fix tx-unthrottle use-after-free
Browse files Browse the repository at this point in the history
commit 49fbb8e upstream.

The driver's transmit-unthrottle work was never flushed on disconnect,
something which could lead to the driver port data being freed while the
unthrottle work is still scheduled.

Fix this by cancelling the unthrottle work when shutting down the port.

Fixes: 1da177e ("Linux-2.6.12-rc2")
Cc: stable@vger.kernel.org
Acked-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
jhovold authored and gregkh committed Dec 30, 2020
1 parent df2754a commit 28a9c26
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/usb/serial/keyspan_pda.c
Expand Up @@ -647,8 +647,12 @@ static int keyspan_pda_open(struct tty_struct *tty,
}
static void keyspan_pda_close(struct usb_serial_port *port)
{
struct keyspan_pda_private *priv = usb_get_serial_port_data(port);

usb_kill_urb(port->write_urb);
usb_kill_urb(port->interrupt_in_urb);

cancel_work_sync(&priv->unthrottle_work);
}


Expand Down

0 comments on commit 28a9c26

Please sign in to comment.