CVE-2026-99672: can: protect the receive lists with a per-device lock

Published Nov 20, 2026
·
Updated

In the Linux kernel, the following vulnerability has been resolved:

can: protect the receive lists with a per-device lock

The receive lists of a CAN device are located in the device's canmlpriv and travel with the device when it is moved to another network namespace. But they are protected by the per-netns rcvlistslock. So canrxunregister() needs devnet(dev) to pick the right lock and silently returns when the passed namespace does not match devnet(dev) anymore.

isotprelease() and bcmrelease() leave their notifier list before they take any lock that serializes against the netdev notifier, which runs under RTNL. When the bound device is moved to another namespace in this window, the notifier skips the socket and the release path has to remove the filters itself. isotprelease() passes the socket's namespace, which does not match devnet(dev) anymore. bcmrxunreg() passes devnet(dev), which canrxunregister() reads again for its check, so a namespace change between both reads makes the check fail as well. In both cases canrxunregister() silently returns. As canrxregister() stores rcv->sk without a reference, the remaining receivers point to the freed socket (isotp) or the freed op (bcm):

BUG: KASAN: use-after-free in isotprcv+0x1570/0x24d0 Read of size 1 at addr ffff888118130552 by task isotpnsuaf/578 canrcvfilter+0x4af/0x8c0 canreceive+0x28d/0x3c0 canrcv+0x2a9/0x310 netifreceiveskbonecore+0x21a/0x260 processbacklog+0x210/0x760

Besides this, the lists of a device are protected by the rcvlistslock of the namespace that is passed in. Callers which pass devnet(dev) read it at different times, so the same lists may be modified under the locks of different namespaces while the device is moved.

Taking RTNL in these release paths is no option: rawbind(), rawsetsockopt() and rawrelease() already hold RTNL while adding and removing up to CANRAWFILTERMAX filters per socket, which unprivileged users can trigger repeatedly and which makes RTNL a global bottleneck.

Instead fix the root cause and add a spinlock to struct candevrcvlists, which protects the receive lists of a CAN device or the 'any' CAN device lists of a namespace. It is initialized in cansetmlpriv(), which is used by all CAN network devices. With this, canrxunregister() finds the subscription independently of the current namespace of the device. The protocols keep the device valid with their tracked references. The per-netns rcvlistslock only protects the receive list statistics anymore, and CANRAW, CANBCM and CANISOTP pass the namespace that has been used for canrxregister().

So isotprelease() and bcmrelease() now remove their filters correctly without RTNL, and rawrelease(), rawsetsockopt(), rawbind() and isotpbind() do not need RTNL anymore and add and remove their filters under locksock(). To serialize bind() with NETDEVUNREGISTER, bind() publishes the device inside the RCU section of its lookup, and rawnotify() and isotpnotify() recheck the bound device under locksock(). As RTNL does not keep NETDEVDOWN out of bind() anymore, bind() checks IFFUP after publishing the bound device, with a barrier pair against rawnotify() and isotpnotify(), so a down transition during bind() is still reported with ENETDOWN.

Affected Software

3 affected componentsFixes available
linux/kernel>=4.12.0<6.12.118
6.12.118
linux/kernel>=6.13.0<6.18.64
6.18.64
linux/kernel>=6.19.0<7.3.5
7.3.5

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 6.12.118
  2. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 6.18.64
  3. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 7.3.5
  4. Compensating control

    Add and initialize a per-device spinlock in struct can_ml_priv and use it to protect the CAN receive lists. Ensure can_rx_unregister() uses the namespace passed to can_rx_register() so it selects the correct lock and subscription.

Frequently Asked Questions

1

What conditions are required for this issue to occur?

A CAN device must be moved to another network namespace during a race window while ISO-TP or BCM socket release is unregistering CAN receive filters. The failed unregister can leave a receiver entry pointing to a freed socket.

2

Which components are implicated by the described race?

The description identifies ISO-TP release handling and BCM release handling, specifically isotp_release() and bcm_release()/bcm_rx_unreg(), together with CAN receive-list registration and unregistration.

3

How could an administrator determine whether systems are exposed to the triggering scenario?

The provided information indicates exposure depends on use of CAN devices, network namespaces, and device moves between namespaces concurrent with ISO-TP or BCM socket teardown. It does not provide a version range or a detection method.

4

What mitigation is described if an update cannot be applied immediately?

No workaround is provided. Based on the described trigger, avoiding moves of CAN devices between network namespaces while related ISO-TP or BCM sockets are being released would avoid the identified race condition.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203