USB: serial: opticon: fix control-message timeouts
authorJohan Hovold <johan@kernel.org>
Mon, 13 Jan 2020 17:22:13 +0000 (18:22 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Tue, 28 Apr 2020 18:03:26 +0000 (19:03 +0100)
commit92f13288053b69ea84cb2ed3f5bd6bfaba8a879d
tree861740e11cb87e2b96b515bc094e78b22c939100
parent8618f8f922fdee3f47ad1e47a1a7e35c465c8891
USB: serial: opticon: fix control-message timeouts

commit 5e28055f340275a8616eee88ef19186631b4d136 upstream.

The driver was issuing synchronous uninterruptible control requests
without using a timeout. This could lead to the driver hanging
on open() or tiocmset() due to a malfunctioning (or malicious) device
until the device is physically disconnected.

The USB upper limit of five seconds per request should be more than
enough.

Fixes: 309a057932ab ("USB: opticon: add rts and cts support")
Cc: Martin Jansen <martin.jansen@opticon.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/usb/serial/opticon.c