can: sun4i_can: populate ndo_change_mtu() to prevent buffer overflow
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 0738eff14d817a02ab082c392c96a1613006f158 · < de77841652e57afbc46e9e1dbf51ee364fc008e1| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
can: sun4i_can: populate ndo_change_mtu() to prevent buffer overflow
Sending an PF_PACKET allows to bypass the CAN framework logic and to directly reach the xmit() function of a CAN driver. The only check which is performed by the PF_PACKET framework is to make sure that skb->len fits the interface's MTU.
Unfortunately, because the sun4i_can driver does not populate its net_device_ops->ndo_change_mtu(), it is possible for an attacker to configure an invalid MTU by doing, for example:
$ ip link set can0 mtu 9999
After doing so, the attacker could open a PF_PACKET socket using the ETH_P_CANXL protocol:
socket(PF_PACKET, SOCK_RAW, htons(ETH_P_CANXL))
to inject a malicious CAN XL frames. For example:
From the CVE record · Linux
The Linux kernel's sun4i_can driver can overflow a buffer if its CAN interface is set to an invalid MTU. A local attacker who can change the interface MTU and send a raw PF_PACKET frame can trigger the overflow; no further user interaction is described.
Engineers running Linux kernels with the sun4i_can driver should check their systems; affected versions were not provided.