netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v5 bpf 0/2] xdp: fix page_pool leaks
@ 2025-10-29 22:13 Maciej Fijalkowski
  2025-10-29 22:13 ` [PATCH v5 bpf 1/2] xdp: introduce xdp_convert_skb_to_buff() Maciej Fijalkowski
  2025-10-29 22:13 ` [PATCH v5 bpf 2/2] veth: update mem type in xdp_buff Maciej Fijalkowski
  0 siblings, 2 replies; 15+ messages in thread
From: Maciej Fijalkowski @ 2025-10-29 22:13 UTC (permalink / raw)
  To: bpf, ast, daniel, hawk
  Cc: netdev, magnus.karlsson, aleksander.lobakin, ilias.apalodimas,
	toke, lorenzo, kuba, Maciej Fijalkowski

v1:
https://lore.kernel.org/bpf/20251003140243.2534865-1-maciej.fijalkowski@intel.com/
v1->v2:
- add skb to xdp_buff converter (Jakub)
- postpone restoration of veth's xdp_rxq_info mem model (AI)

v2:
https://lore.kernel.org/bpf/20251017143103.2620164-1-maciej.fijalkowski@intel.com/T/
v2->v3:
- make skb->xdp_buff conversion agnostic of current skb->data position
  (Toke)
- do not pull mac header in veth (Toke)
- use virt_to_head_page() when checking if xdp->data comes from
  page_pool (Olek)
- add ack from Toke

v3:
https://lore.kernel.org/bpf/20251022125209.2649287-1-maciej.fijalkowski@intel.com/
v3->v4:
- include skb->head when calculating packet length (Toke, lkp)

v4:
https://lore.kernel.org/bpf/20251027121318.2679226-1-maciej.fijalkowski@intel.com/
v4->v5:
- rely again on sk_buff::pp_recycle when setting mem type on rxq
  (Jesper, Jakub)
- add ack from Toke on patch 2 and restore it on patch 1


Hi,

here we fix page_pool leaks which happen when fragment is released
within XDP program and memory type is set incorrectly. The reports come
from syzbot and AF_XDP test suite.

Most of the changes are about pulling out the common code for
init/prepare xdp_buff based on existing skb and supplying it with
correct xdp_rxq_info's mem_type that is assigned to xdp_buff. A bit more
stuff, page_pool related, had to be done on veth side.

Originally, this work was started by Octavian Purdila.

Thanks!


Maciej Fijalkowski (2):
  xdp: introduce xdp_convert_skb_to_buff()
  veth: update mem type in xdp_buff

 drivers/net/veth.c | 43 ++++++++++++++++++++++++++-----------------
 include/net/xdp.h  | 25 +++++++++++++++++++++++++
 net/core/dev.c     | 25 ++++---------------------
 3 files changed, 55 insertions(+), 38 deletions(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2025-11-05 18:39 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-29 22:13 [PATCH v5 bpf 0/2] xdp: fix page_pool leaks Maciej Fijalkowski
2025-10-29 22:13 ` [PATCH v5 bpf 1/2] xdp: introduce xdp_convert_skb_to_buff() Maciej Fijalkowski
2025-10-29 23:50   ` Jakub Kicinski
2025-10-30 12:14     ` Maciej Fijalkowski
2025-10-30 15:25       ` Jakub Kicinski
2025-10-30 20:22         ` Maciej Fijalkowski
2025-10-31  2:05           ` Jakub Kicinski
2025-10-31 11:37             ` Maciej Fijalkowski
2025-10-31 18:49               ` Jakub Kicinski
2025-11-03 12:16                 ` Maciej Fijalkowski
2025-11-05 18:39                   ` Jesper Dangaard Brouer
2025-10-29 22:13 ` [PATCH v5 bpf 2/2] veth: update mem type in xdp_buff Maciej Fijalkowski
2025-10-29 22:59   ` bot+bpf-ci
2025-10-31 12:46     ` Maciej Fijalkowski
2025-10-31 13:45       ` Chris Mason

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).