CVE-2025-38004: can: bcm: add locking for bcm_op runtime updates
In the Linux kernel, the following vulnerability has been resolved:
can: bcm: add locking for bcmop 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 bcmcantx(). Anderson Nascimento created a proof of concept that triggered a KASAN slab-out-of-bounds read access which can be prevented with a spinlockbh.
At the rework of bcmcantx() the 'count' variable has been moved into the protected section as this variable can be modified from both contexts too.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.1.176-1Fixed in 6.1.190-1Fixed in 6.12.107-1Fixed in 6.12.113-1Fixed in 7.2.12-1Fixed in 7.2.13-1 - Compensating control
Protect bcm_op runtime updates in bcm_can_tx() with spin_lock_bh, including the currframe counter and count variable, to prevent the KASAN slab-out-of-bounds read.
Event History
Frequently Asked Questions
What is the severity of CVE-2025-38004?
The severity of CVE-2025-38004 is classified as medium due to the potential for a denial of service.
How do I fix CVE-2025-38004?
To fix CVE-2025-38004, update your Linux kernel to the latest version that contains the patch.
Which versions of the Linux kernel are affected by CVE-2025-38004?
CVE-2025-38004 affects Linux kernel versions 2.6.25 up to 6.15-rc7.
What is the nature of the vulnerability in CVE-2025-38004?
CVE-2025-38004 involves the CAN broadcast manager allowing changes to the frame sequence in a potentially unsafe way.
Who reported CVE-2025-38004 and when?
CVE-2025-38004 was reported by the Linux kernel development team as part of their ongoing security improvements.