CVE-2024-26853
Severity CVSS v4.0:
Pending analysis
Type:
CWE-787
Out-of-bounds Write
Publication date:
17/04/2024
Last modified:
02/04/2025
Description
In the Linux kernel, the following vulnerability has been resolved:<br />
<br />
igc: avoid returning frame twice in XDP_REDIRECT<br />
<br />
When a frame can not be transmitted in XDP_REDIRECT<br />
(e.g. due to a full queue), it is necessary to free<br />
it by calling xdp_return_frame_rx_napi.<br />
<br />
However, this is the responsibility of the caller of<br />
the ndo_xdp_xmit (see for example bq_xmit_all in<br />
kernel/bpf/devmap.c) and thus calling it inside<br />
igc_xdp_xmit (which is the ndo_xdp_xmit of the igc<br />
driver) as well will lead to memory corruption.<br />
<br />
In fact, bq_xmit_all expects that it can return all<br />
frames after the last successfully transmitted one.<br />
Therefore, break for the first not transmitted frame,<br />
but do not call xdp_return_frame_rx_napi in igc_xdp_xmit.<br />
This is equally implemented in other Intel drivers<br />
such as the igb.<br />
<br />
There are two alternatives to this that were rejected:<br />
1. Return num_frames as all the frames would have been<br />
transmitted and release them inside igc_xdp_xmit.<br />
While it might work technically, it is not what<br />
the return value is meant to represent (i.e. the<br />
number of SUCCESSFULLY transmitted packets).<br />
2. Rework kernel/bpf/devmap.c and all drivers to<br />
support non-consecutively dropped packets.<br />
Besides being complex, it likely has a negative<br />
performance impact without a significant gain<br />
since it is anyway unlikely that the next frame<br />
can be transmitted if the previous one was dropped.<br />
<br />
The memory corruption can be reproduced with<br />
the following script which leads to a kernel panic<br />
after a few seconds. It basically generates more<br />
traffic than a i225 NIC can transmit and pushes it<br />
via XDP_REDIRECT from a virtual interface to the<br />
physical interface where frames get dropped.<br />
<br />
#!/bin/bash<br />
INTERFACE=enp4s0<br />
INTERFACE_IDX=`cat /sys/class/net/$INTERFACE/ifindex`<br />
<br />
sudo ip link add dev veth1 type veth peer name veth2<br />
sudo ip link set up $INTERFACE<br />
sudo ip link set up veth1<br />
sudo ip link set up veth2<br />
<br />
cat
Impact
Base Score 3.x
5.50
Severity 3.x
MEDIUM
Vulnerable products and versions
| CPE | From | Up to |
|---|---|---|
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 5.13 (including) | 6.1.82 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 6.2 (including) | 6.6.22 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 6.7 (including) | 6.7.10 (excluding) |
| cpe:2.3:o:linux:linux_kernel:6.8:rc1:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:6.8:rc2:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:6.8:rc3:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:6.8:rc4:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:6.8:rc5:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:6.8:rc6:*:*:*:*:*:* |
To consult the complete list of CPE names with products and versions, see this page
References to Advisories, Solutions, and Tools
- https://git.kernel.org/stable/c/1b3b8231386a572bac8cd5b6fd7e944b84f9bb1f
- https://git.kernel.org/stable/c/63a3c1f3c9ecc654d851e7906d05334cd0c236e2
- https://git.kernel.org/stable/c/8df393af9e7e8dfd62e9c41dbaa4d2ff53bf794a
- https://git.kernel.org/stable/c/ef27f655b438bed4c83680e4f01e1cde2739854b
- https://git.kernel.org/stable/c/1b3b8231386a572bac8cd5b6fd7e944b84f9bb1f
- https://git.kernel.org/stable/c/63a3c1f3c9ecc654d851e7906d05334cd0c236e2
- https://git.kernel.org/stable/c/8df393af9e7e8dfd62e9c41dbaa4d2ff53bf794a
- https://git.kernel.org/stable/c/ef27f655b438bed4c83680e4f01e1cde2739854b



