Skip to content

CDC_WDM: fix hangs and error reporting in multithreaded cases

Oliver Neukum linux-usb 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest7 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7CDC-WDM: fix hangs in flush() in multithreaded casesdrivers/usb/class/cdc-wdm.c+7 -40 replies
2/7CDC-WDM: introduce a timeout in flush()drivers/usb/class/cdc-wdm.c+9 -20 replies
3/7CDC-WDM: remove use of intf->dev after potential disconnectdrivers/usb/class/cdc-wdm.c+5 -40 replies
4/7CDC-WDM: fix race reporting errors in flushdrivers/usb/class/cdc-wdm.c+3 -00 replies
5/7CDC-WDM: correct error reporting in write()drivers/usb/class/cdc-wdm.c+3 -00 replies
6/7CDC-WDM: implement fsyncdrivers/usb/class/cdc-wdm.c+28 -00 replies
7/7CDC-WDM: making flush() interruptibledrivers/usb/class/cdc-wdm.c+3 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/7]CDC_WDM: fix hangs and error reporting in multithreaded cases

Testing has shown

1. race conditions in the multithreaded use case
2. a vulnerability against malicious hardware
3. a minor race against disconnect() in flush()

in the CDC-WDM driver. All have a common cause in the interactions of the flush() method with other parts of the driver. Hence they require a common rework of the flush() method.

Long and exhaustive discussion and testing of these changes, however, revealed that they in turn introduce problems with error reporting and long periods of uninterruptible sleep. Those require further changes to flush() and the implementation of fsync().

The issue dates back to the introduction of the driver so the fixes also should go into stable.