veth: convert frag_list skbs before running XDP
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 718a18a0c8a67f97781e40bdef7cdd055c430996 · < d0d6415963040c401e7a7e4e482a698ba52448cb| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
veth: convert frag_list skbs before running XDP
A frag_list skb can reach veth with data_len set but nr_frags zero. veth_convert_skb_to_xdp_buff() only converts skbs that are shared, locked, have frags[], or do not have enough headroom. It later uses skb_is_nonlinear() to decide whether to set XDP_FLAGS_HAS_FRAGS and xdp_frags_size.
That exposes frag_list data to XDP as if it were stored in frags[], but frags[] is empty. AF_XDP copy mode can then trust the bogus XDP fragment metadata, walk an empty fragment entry, and crash in memcpy() from __xsk_rcv().
Route non-linear skbs through skb_pp_cow_data() before exposing them to XDP, and only advertise XDP frags when the resulting skb has frags[]. skb_copy_bits() already handles frag_list input, and skb_pp_cow_data() builds frags[] output with skb_add_rx_frag(), which is the representation XDP multi-buffer expects.
From the CVE record · Linux
The Linux kernel's veth XDP path can misrepresent frag_list packet data as fragments that are not present. If such a packet reaches veth, AF_XDP copy mode can trust the incorrect metadata and crash the kernel during memcpy(). The input does not specify whether triggering this requires network access, authentication, or user interaction.
Engineers running Linux kernels with veth and AF_XDP copy mode should check their versions against the vendor advisory; affected versions are not specified.