can: hi311x: populate ndo_change_mtu() to prevent buffer overflow
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 57e83fb9b7468c75cb65cde1d23043553c346c6d · < def814b4ba31b563584061d6895d5ff447d5bc14| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
can: hi311x: 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 hi311x CAN driver can overflow a transmit buffer if an attacker sets an invalid CAN interface MTU and injects a crafted CAN XL frame through a PF_PACKET socket. The attack requires local access to configure the interface and send the packet; no user interaction is described.
Engineers running Linux systems that use the hi311x CAN driver should check their kernel; affected versions are not specified.