usb: class: cdc-wdm: fix reordering issue in read code path
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ afba937e540c902c989cd516fd97ea0c8499bb27 · < 67ed312124bb1b61858778ac0b985b48961c862a| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
usb: class: cdc-wdm: fix reordering issue in read code path
Quoting the bug report:
Due to compiler optimization or CPU out-of-order execution, the desc->length update can be reordered before the memmove. If this happens, wdm_read() can see the new length and call copy_to_user() on uninitialized memory. This also violates LKMM data race rules [1].
Fix it by using WRITE_ONCE and memory barriers.
From the CVE record · Linux
The Linux kernel cdc-wdm read path can update a length value before moving the associated data because of compiler or CPU reordering. When a local caller reads from the device, wdm_read() may copy uninitialized memory to user space.
Engineers running Linux kernels with the cdc-wdm USB class driver should check whether their kernel includes the fix; affected versions were not specified.