Input: keyspan-remote: fix control-message timeouts
Subsystems (4)
PATCH 1/1 Input: keyspan-remote: fix control-message timeouts
The driver was issuing synchronous uninterruptible control requests without using a timeout. This could lead to the driver hanging on probe due to a malfunctioning (or malicious) device until the device is physically disconnected. While sleeping in probe the driver prevents other devices connected to the same hub from being added to (or removed from) the bus.
The USB upper limit of five seconds per request should be more than enough.
--- drivers/input/misc/keyspan_remote.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/input/misc/keyspan_remote.c +6 -3
@@ -336,7 +336,8 @@ static int keyspan_setup(struct usb_device* dev)int retval =0 ; retval =usb_control_msg (dev,usb_sndctrlpipe (dev,0 ), -0x11 ,0x40 ,0x5601 ,0x0 ,NULL ,0 ,0 ); +0x11 ,0x40 ,0x5601 ,0x0 ,NULL ,0 , +USB_CTRL_SET_TIMEOUT );if (retval) {dev_dbg (&dev->dev,"%s - failed to set bit rate due to error: %d\n" , __func__, retval);
@@ -344,7 +345,8 @@ static int keyspan_setup(struct usb_device* dev) } retval =usb_control_msg (dev,usb_sndctrlpipe (dev,0 ), -0x44 ,0x40 ,0x0 ,0x0 ,NULL ,0 ,0 ); +0x44 ,0x40 ,0x0 ,0x0 ,NULL ,0 , +USB_CTRL_SET_TIMEOUT );if (retval) {dev_dbg (&dev->dev,"%s - failed to set resume sensitivity due to error: %d\n" , __func__, retval);
@@ -352,7 +354,8 @@ static int keyspan_setup(struct usb_device* dev) } retval =usb_control_msg (dev,usb_sndctrlpipe (dev,0 ), -0x22 ,0x40 ,0x0 ,0x0 ,NULL ,0 ,0 ); +0x22 ,0x40 ,0x0 ,0x0 ,NULL ,0 , +USB_CTRL_SET_TIMEOUT );if (retval) {dev_dbg (&dev->dev,"%s - failed to turn receive on due to error: %d\n" , __func__, retval);
Signature · 1 line
2.24.1
Quoted 10 lines · Johan Hovold
The driver was issuing synchronous uninterruptible control requests without using a timeout. This could lead to the driver hanging on probe due to a malfunctioning (or malicious) device until the device is physically disconnected. While sleeping in probe the driver prevents other devices connected to the same hub from being added to (or removed from) the bus.
The USB upper limit of five seconds per request should be more than enough.
Quoted 7 lines
Fixes 99f83c9c9ac9 ("[PATCH] USB: add driver for Keyspan Digital Remote")Cc stable <[email protected]> # 2.6.13Signed-off-by Johan Hovold <[email protected]>--- drivers/input/misc/keyspan_remote.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)