summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorOliver Neukum <oneukum@suse.com>2018-10-04 15:49:06 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-10-09 16:13:42 +0200
commit9397940ed812b942c520e0c25ed4b2c64d57e8b9 (patch)
tree49b483d6fa9f63c7578990c410d0e31fd968c57b /drivers
parentusb: usbip: Fix BUG: KASAN: slab-out-of-bounds in vhci_hub_control() (diff)
downloadlinux-9397940ed812b942c520e0c25ed4b2c64d57e8b9.tar.xz
linux-9397940ed812b942c520e0c25ed4b2c64d57e8b9.zip
cdc-acm: fix race between reset and control messaging
If a device splits up a control message and a reset() happens between the parts, the message is lost and already recieved parts must be dropped. Signed-off-by: Oliver Neukum <oneukum@suse.com> Fixes: 1aba579f3cf51 ("cdc-acm: handle read pipe errors") Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/class/cdc-acm.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index bc03b0a690b4..1833912f7f5f 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -1642,6 +1642,7 @@ static int acm_pre_reset(struct usb_interface *intf)
struct acm *acm = usb_get_intfdata(intf);
clear_bit(EVENT_RX_STALL, &acm->flags);
+ acm->nb_index = 0; /* pending control transfers are lost */
return 0;
}