can: bcm: add locking for bcm_op runtime updates
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ ffd980f976e7fd666c2e61bf8ab35107efd11828 · < cc55dd28c20a6611e30596019b3b2f636819a4c0| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
can: bcm: add locking for bcm_op runtime updates
The CAN broadcast manager (CAN BCM) can send a sequence of CAN frames via hrtimer. The content and also the length of the sequence can be changed resp reduced at runtime where the 'currframe' counter is then set to zero.
Although this appeared to be a safe operation the updates of 'currframe' can be triggered from user space and hrtimer context in bcm_can_tx(). Anderson Nascimento created a proof of concept that triggered a KASAN slab-out-of-bounds read access which can be prevented with a spin_lock_bh.
At the rework of bcm_can_tx() the 'count' variable has been moved into the protected section as this variable can be modified from both contexts too.
From the CVE record · Linux
The Linux kernel's CAN broadcast manager has a race between user-space updates to a CAN frame sequence and timer-driven transmission. A local user can trigger a slab out-of-bounds read by changing the sequence while it is in use.
Engineers running Linux kernels with the CAN broadcast manager should check whether their kernel includes the fix; affected versions were not specified.