CVE-2026-99674: can: dev: can_dropped_invalid_skb: drop CAN XL frames on non-CAN XL devices
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
can: dev: can_dropped_invalid_skb: drop CAN XL frames on non-CAN XL devices
Sending a PF_PACKET bypasses the CAN framework logic and can directly reach a CAN driver's xmit() function. The PF_PACKET framework only checks that skb->len does not exceed the net_device MTU.
For a CAN device that is not CAN XL capable, anything above CANFD_MTU (72 bytes) is therefore dropped before it reaches the driver. However, CAN XL frames are variable length. can_is_canxl_skb() accepts lengths in the range CANXL_HDR_SIZE + CANXL_MIN_DLEN up to CANXL_MTU, i.e. 13 to 2060 bytes.
As a result, an ETH_P_CANXL skb with a length between 13 and 72 bytes can pass both the MTU and the can_dropped_invalid_skb() checks.
A driver that does not support CAN XL will interpret canxl_frame->flags as a length because of the overlap with can_frame->len. And because CANXL_XLF is set, the resulting length is between 128 and 255. For drivers that do not check can_frame->len before copying can_frame->data, as most drivers do, this results in a buffer overflow of up to 247 bytes.
Drop ETH_P_CANXL skbs if the device does not have the CAN_CAP_XL capability. Keep can_is_canxl_skb() for the validation of CAN XL skbs.
The Linux kernel CVE team has assigned CVE-2026-99674 to this issue.
Affected and fixed versions
===========================
Issue introduced in 6.1 with commit fb08cba12b52cba4366e858932307649dc5304e2 and fixed in 7.3.5 with commit 2de9c3df452e159f82ef14ca497e5be407c66493 Issue introduced in 6.1 with commit fb08cba12b52cba4366e858932307649dc5304e2 and fixed in 7.4-rc2 with commit 0fce44e29fce4b07642491b098afb41bd571e4f2
Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.
Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at
https://cve.org/CVERecord/?id=CVE-2026-99674
will be updated if fixes are backported, please check that for the most up to date information about this issue.
Affected files
==============
The file(s) affected by this issue are:
drivers/net/can/dev/skb.c
Mitigation
==========
The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:
https://git.kernel.org/stable/c/2de9c3df452e159f82ef14ca497e5be407c66493 https://git.kernel.org/stable/c/0fce44e29fce4b07642491b098afb41bd571e4f2