can: bcm: extend bcm_tx_lock usage for data and timer updates
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ c2aba69d0c36a496ab4f2e81e9c2b271f2693fd7 · < bd46f55dec608daa44b45dcf3328517630ad8e40| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
can: bcm: extend bcm_tx_lock usage for data and timer updates
Stage new CAN frame content for an existing tx op into a kmalloc()'d buffer and validate it there, mirroring the approach already used in bcm_rx_setup(). Only copy the validated data into op->frames while holding op->bcm_tx_lock, so bcm_can_tx() and bcm_tx_timeout_handler() can no longer observe a partially updated or unvalidated frame.
Add a missing error path for memcpy_from_msg() when copying CAN frame data from userspace.
Also move the kt_ival1/kt_ival2/ival1/ival2 updates in bcm_tx_setup() under op->bcm_tx_lock, and read kt_ival1/kt_ival2/count under the same lock in bcm_tx_set_expiry() and bcm_tx_timeout_handler(), closing the torn 64-bit ktime_t read on 32-bit platforms.
From the CVE record · Linux
The Linux kernel's CAN BCM transmit path can expose partially updated or unvalidated frames during concurrent operations. A local user submitting CAN frame data may trigger this condition; timer values can also be read inconsistently on 32-bit platforms. The input does not specify authentication requirements or a required user interaction beyond submitting frame data.
Engineers running Linux kernels with CAN BCM support should check their kernel version; affected versions are not specified.