virtio-net: xsk: rx: fix the frame's length check
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
6.12.376.15.66.16In the Linux kernel, the following vulnerability has been resolved:
virtio-net: xsk: rx: fix the frame's length check
When calling buf_to_xdp, the len argument is the frame data's length without virtio header's length (vi->hdr_len). We check that len with
xsk_pool_get_rx_frame_size() + vi->hdr_len
to ensure the provided len does not larger than the allocated chunk size. The additional vi->hdr_len is because in virtnet_add_recvbuf_xsk, we use part of XDP_PACKET_HEADROOM for virtio header and ask the vhost to start placing data from
hard_start + XDP_PACKET_HEADROOM - vi->hdr_len not hard_start + XDP_PACKET_HEADROOM
But the first buffer has virtio_header, so the maximum frame's length in the first buffer can only be
xsk_pool_get_rx_frame_size() not xsk_pool_get_rx_frame_size() + vi->hdr_len
From the CVE record · Linux
The Linux kernel's virtio-net XSK receive path incorrectly allows the first buffer's frame length to include space reserved for the virtio header. An attacker who can supply a frame to this path could cause an oversized frame to pass the length check; the input does not establish authentication or user-interaction requirements.
Engineers running Linux kernels that use the virtio-net XSK receive path should check their kernel; affected versions were not provided.