Files
erofs-linux/drivers/usb/class
Oliver Neukum 8df672bfe3 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.

Fixes: afba937e54 ("USB: CDC WDM driver")
Cc: stable <[email protected]>
Signed-off-by: Oliver Neukum <[email protected]>
Closes: https://lore.kernel.org/linux-usb/CALbr=LbrUZn_cfp7CfR-7Z5wDTHF96qeuM=3fO2m-q4cDrnC4A@mail.gmail.com/
Reported-by: Gui-Dong Han <[email protected]>
Reviewed-by: Gui-Dong Han <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2026-03-11 16:18:31 +01:00
..
…
…