Re: [PATCH net] xdp: use multi-buff only if receive queue supports page pool

From
Jakub Kicinski <kuba@kernel.org>
Date
2025-09-25 00:09:17
Also in
bpf
Reply to
Octavian Purdila, 2025-09-24
On Wed, 24 Sep 2025 06:08:42 +0000 Octavian Purdila wrote:
When a BPF program that supports BPF_F_XDP_HAS_FRAGS is issuing
bpf_xdp_adjust_tail and a large packet is injected via /dev/net/tun a
crash occurs due to detecting a bad page state (page_pool leak).

This is because xdp_buff does not record the type of memory and
instead relies on the netdev receive queue xdp info. Since the TUN/TAP
driver is using a MEM_TYPE_PAGE_SHARED memory model buffer, shrinking
will eventually call page_frag_free. But with current multi-buff
support for BPF_F_XDP_HAS_FRAGS programs buffers are allocated via the
page pool.

To fix this issue check that the receive queue memory mode is of
MEM_TYPE_PAGE_POOL before using multi-buffs.
This can also happen on veth, right? And veth re-stamps the Rx queues.
Thread (10 messages) 10 messages, 3 authors, last reply 2025-09-30
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help