can: gs_usb: gs_usb_receive_bulk_callback(): check actual_length before accessing data
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
can: gs_usb: gs_usb_receive_bulk_callback(): check actual_length before accessing data
The URB received in gs_usb_receive_bulk_callback() contains a struct gs_host_frame. The length of the data after the header depends on the gs_host_frame hf::flags and the active device features (e.g. time stamping).
Introduce a new function gs_usb_get_minimum_length() and check that we have at least received the required amount of data before accessing it. Only copy the data to that skb that has actually been received.
[mkl: rename gs_usb_get_minimum_length() -> +gs_usb_get_minimum_rx_length()]
From the CVE record · Linux
The Linux kernel gs_usb receive callback did not check that a received USB frame contained enough data before accessing it. A short frame could cause an out-of-bounds access; the input does not specify attacker access requirements or whether user interaction is needed.
Engineers running Linux kernels with the gs_usb driver should check their installations; affected versions are not specified.