Skip to contentSkip to conversation

patch "USB: serial: opticon: fix control-message timeouts" added to usb-linus

PATCH [email protected] 1 participant 1 message Jan 17, 2020

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

USB: serial: opticon: fix control-message timeouts

to my usb git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
in the usb-linus branch.

The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.)

The patch will hopefully also be merged in Linus's tree for the next -rc kernel release.

If you have any questions about this process, please let me know.

From 5e28055f340275a8616eee88ef19186631b4d136 Mon Sep 17 00:00:00 2001
From: Johan Hovold <[email protected]>
Date: Mon, 13 Jan 2020 18:22:13 +0100
Subject: 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.

Fixes 309a057932ab ("USB: opticon: add rts and cts support")
Cc stable <[email protected]> # 2.6.39
Cc Martin Jansen <[email protected]>
---
 drivers/usb/serial/opticon.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/serial/opticon.c +1 -1
index cb7aac9cd9e7..ed2b4e6dca38 100644
@@ -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.25.0