can: bcm: fix locking for bcm_op runtime updates
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ c2aba69d0c36a496ab4f2e81e9c2b271f2693fd7 · < 8215ba7bc99e84e66fd6938874ec4330a9d96518| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
can: bcm: fix locking for bcm_op runtime updates
Commit c2aba69d0c36 ("can: bcm: add locking for bcm_op runtime updates") added a locking for some variables that can be modified at runtime when updating the sending bcm_op with a new TX_SETUP command in bcm_tx_setup().
Usually the RX_SETUP only handles and filters incoming traffic with one exception: When the RX_RTR_FRAME flag is set a predefined CAN frame is sent when a specific RTR frame is received. Therefore the rx bcm_op uses bcm_can_tx() which uses the bcm_tx_lock that was only initialized in bcm_tx_setup(). Add the missing spin_lock_init() when allocating the bcm_op in bcm_rx_setup() to handle the RTR case properly.
From the CVE record · Linux
The Linux kernel's CAN BCM code fails to initialize a lock for receive operations configured with RX_RTR_FRAME. When a matching RTR frame is received, the code can attempt to transmit a predefined CAN frame using that uninitialized lock; the input does not specify authentication or user-interaction requirements.
Operators running the Linux kernel should check whether their kernel includes the affected CAN BCM code; affected versions are not specified.