CVE-2026-99673: can: replace ARPHRD_CAN type checks with can_get_ml_priv()
In the Linux kernel, the following vulnerability has been resolved:
can: replace ARPHRDCAN type checks with cangetmlpriv()
Commit 4e096a18867a ("net: introduce CAN specific pointer in the struct netdevice") introduced an explicit way to assign the midlayer private pointer (dev->mlpriv) to named users like MLPRIVCAN. A valid pointer returned by cangetmlpriv() therefore identifies a real CAN device.
The referenced commit only converted the j1939 and proc code to this check, while the other parts of the CAN subsystem still rely on dev->type == ARPHRDCAN.
The TUNSETLINK ioctl allows a down TUN/TAP device to set its hardware type to ARPHRDCAN while dev->mlpriv remains NULL. Such a repurposed netdevice passes the ARPHRDCAN checks.
Commit 8aa59e355949 ("can: afcan: fix NULL pointer dereference in canrxregister()") already made canrxregister() reject such devices. But canrxunregister() still only checks dev->type and dereferences the NULL mlpriv when it walks the receive lists of the device.
CANISOTP reaches this path: isotpbind() ignores the return values of canrxregister() and binds the socket anyway. When the socket is released or the device is unregistered, isotprelease() and isotpnotify() remove the filters that have never been registered and trigger the NULL pointer dereference in canrxunregister(). This only requires owning a TUN/TAP device or CAPNETADMIN in an unprivileged user namespace.
Convert the remaining ARPHRDCAN checks in afcan, bcm, gw, isotp and raw to cangetmlpriv().
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 5.5 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 5.11 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 5.12 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.12.118 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.18.64 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.5
Frequently Asked Questions
What conditions are needed to reach the NULL dereference?
A down TUN/TAP device must be changed to hardware type ARPHRD_CAN using the TUNSETLINK ioctl while its dev->ml_priv remains NULL. This lets the repurposed device pass checks that rely only on dev->type == ARPHRD_CAN.
Which code path can trigger the issue after such a device is created?
CAN_ISOTP can reach it because isotp_bind() ignores failures from can_rx_register() and still binds the socket. Releasing that socket or unregistering the device can then call can_rx_unregister(), which dereferences the NULL midlayer-private pointer.
Why does the existing can_rx_register() protection not prevent this issue?
can_rx_register() already rejects devices without a valid CAN midlayer-private pointer. However, can_rx_unregister() continued to validate only the ARPHRD_CAN hardware type, allowing it to operate on the repurposed TUN/TAP device despite its NULL dev->ml_priv.