USB: serial: opticon: fix control-message timeouts
Subsystems (3)
Johan Hovold
maintainerPATCH 1/1 USB: serial: opticon: fix control-message timeouts
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.
---
This was reported to me off-list to be an issue with some opticon devices. Let's address the obvious bug while waiting for a bug report to be sent to the list.
Johan
drivers/usb/serial/opticon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/serial/opticon.c +1 -1
@@ -113,7 +113,7 @@ static int send_control_msg(struct usb_serial_port *port, u8 requesttype, retval =usb_control_msg (serial->dev,usb_sndctrlpipe (serial->dev,0 ), requesttype,USB_DIR_OUT |USB_TYPE_VENDOR |USB_RECIP_INTERFACE , -0 ,0 , buffer,1 ,0 ); +0 ,0 , buffer,1 ,USB_CTRL_SET_TIMEOUT );kfree (buffer);if (retval <0 )
Signature · 1 line
2.24.1
Quoted 5 lines · Johan Hovold
The driver was issuing synchronous uninterruptible control requests without using a timeout. This could lead to the driver hanging on
open()ortiocmset()due to a malfunctioning (or malicious) device until the device is physically disconnected.
Quoted 7 lines
The USB upper limit of five seconds per request should be more than enough.
Fixes 309a057932ab ("USB: opticon: add rts and cts support")Cc stable <[email protected]> # 2.6.39Cc Martin Jansen <[email protected]>Signed-off-by Johan Hovold <[email protected]>
Johan Hovold
maintainerQuoted 9 lines · Greg Kroah-Hartman
Quoted 8 lines · Johan Hovold
The driver was issuing synchronous uninterruptible control requests without using a timeout. This could lead to the driver hanging on
open()ortiocmset()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.
Quoted 6 lines
Quoted 4 lines
Fixes 309a057932ab ("USB: opticon: add rts and cts support")Cc stable <[email protected]> # 2.6.39Cc Martin Jansen <[email protected]>Signed-off-by Johan Hovold <[email protected]>Reviewed-by Greg Kroah-Hartman <[email protected]>
Thanks for reviewing these. This one; now applied.
Johan