AZL-115486: CVE-2026-99672 affecting package kernel 6.6.161.1-1
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.