can: bcm: fix data race on rx_stamp/rx_ifindex in bcm_rx_handler()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ ffd980f976e7fd666c2e61bf8ab35107efd11828 · < 136de17f38630307991c59aa7080012a99451783| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
can: bcm: fix data race on rx_stamp/rx_ifindex in bcm_rx_handler()
For an rx op subscribed on all interfaces (ifindex == 0), the same op is registered once in the shared per-netns wildcard filter list, so bcm_rx_handler() can run concurrently on different CPUs for frames arriving on different net devices.
op->rx_stamp and op->rx_ifindex were written before bcm_rx_update_lock was taken, allowing concurrent writers to race each other - including a torn store of the 64-bit rx_stamp on 32-bit platforms.
Beyond a torn store bcm_send_to_user() must report the timestamp/ifindex of the very same frame whose content it is delivering. So the assignment is placed in the same unbroken bcm_rx_update_lock section as the content comparison.
As a side effect, the RTR-request frame feature (which never reach bcm_send_to_user()) no longer updates rx_stamp/rx_ifindex, since only the notification path needs them.
From the CVE record · Linux
The Linux kernel CAN BCM receive handler has a data race when an RX operation subscribes to all interfaces and frames arrive concurrently on different network devices. Concurrent writes can produce an incorrect timestamp or interface index, including a torn timestamp on 32-bit platforms. The input does not specify an attacker access requirement or user interaction.
Engineers running Linux kernels that use CAN BCM should check their kernel versions; affected versions are not specified.