can: bcm: fix lockless bound/ifindex race and silent RX_SETUP failure
- Published
- Last modified
- Where the record stands: published, rejected by its publisher, or superseded by another id.What do these mean? →
- published
- Whether CISA lists it in its Known Exploited Vulnerabilities catalog: proof that attackers are using it.What do these mean? →
- Not listed in CISA KEV
- Fix
- Fixed in 5.10.261, 5.15.212, 6.1.178, 6.6.145, 6.12.97, and 2 more
- Whether working attack code is public (Exploit-DB, Metasploit, Nuclei or GitHub). Public code makes attacks easier.What do these mean? →
- None on Exploit-DB, Metasploit or GitHub
- Exploitation: none
- Automatable: no
- Technical impact: total
Summary
In the Linux kernel, the following vulnerability has been resolved: can: bcm: fix lockless bound/ifindex race and silent RX_SETUP failure bcm_sendmsg() reads bo->ifindex and checks bo->bound before taking lock_sock(), while bcm_notify(), bcm_connect() and bcm_release() all mutate both fields under that same lock. Because the lockless reads and the locked writes are unordered with respect to each other, a racing bcm_notify() (device unregister) or bcm_connect() (concurrent bind on another thread sharing the socket) can make bcm_sendmsg() observe an inconsistent combination, e.g. a stale bound=1 together with the now-cleared ifindex=0, silently turning a socket bound to a specific CAN interface into one that also matches "any" interface. Keep the lockless bo->bound check purely as a fast-path reject, and move the ifindex read (and a bo->bound re-check) into the locked section, where every writer already serializes. This removes the possibility of observing the two fields torn against each other, rather than trying to fix it with more READ_ONCE()/WRITE_ONCE() pairs on two independently updated fields. Annotate the now-purely-lockless bo->bound accesses consistently across all its write sites. Also fix bcm_rx_setup() silently returning success when the target device disappears concurrently instead of reporting -ENODEV, so a broken RX op is no longer left registered as if it had succeeded.
Timeline
- CVE published
- CISA SSVC assessment
Exploitation: none · Automatable: no · Technical impact: total
- Record last updated
Affected versions
- Linux Linux
From ffd980f976e7fd666c2e61bf8ab35107efd11828 · fixed in 9e60c586faeaed80d55ab8ce2a4b8e56133bc395; From ffd980f976e7fd666c2e61bf8ab35107efd11828 · fixed in ffa80a2af27c97453861a5128e537214a31cd18a; From ffd980f976e7fd666c2e61bf8ab35107efd11828 · fixed in 6bcc5cd247c2934373bc2a1cdf8bf12321169543; From ffd980f976e7fd666c2e61bf8ab35107efd11828 · fixed in 0f6f9f95294b4cbb26ba02209e893e3bd91237c3; From ffd980f976e7fd666c2e61bf8ab35107efd11828 · fixed in b70f1a15533afeeec5d07f20bec3f3867ab1c7b6; From ffd980f976e7fd666c2e61bf8ab35107efd11828 · fixed in 35f0ac19efb1a3f6c5e12c00e475a9ec2d9c3a6d; From ffd980f976e7fd666c2e61bf8ab35107efd11828 · fixed in b9c6ac6fb4e01b34575816066e5d3890a57b3c86; From ffd980f976e7fd666c2e61bf8ab35107efd11828 · fixed in d9b091d9d22fee81ec53fb55d2032951993ceadb
- Linux Linux
2.6.25
- KernelLinux
From 2.6.25 · fixed in 5.10.261; From 5.11.0 · fixed in 5.15.212; From 5.16.0 · fixed in 6.1.178; From 6.2.0 · fixed in 6.6.145; From 6.7.0 · fixed in 6.12.97; From 6.13.0 · fixed in 6.18.40; From 6.19.0 · fixed in 7.1.5
References 8
git.kernel.org
- stable/c/9e60c586faeaed80d55ab8ce2a4b8e56133bc395
- stable/c/ffa80a2af27c97453861a5128e537214a31cd18a
- stable/c/6bcc5cd247c2934373bc2a1cdf8bf12321169543
- stable/c/0f6f9f95294b4cbb26ba02209e893e3bd91237c3
- stable/c/b70f1a15533afeeec5d07f20bec3f3867ab1c7b6
- stable/c/35f0ac19efb1a3f6c5e12c00e475a9ec2d9c3a6d
- stable/c/b9c6ac6fb4e01b34575816066e5d3890a57b3c86
- stable/c/d9b091d9d22fee81ec53fb55d2032951993ceadb