All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net 0/9] xsk: ZC mbuf fixes
@ 2026-11-02 12:49 Maciej Fijalkowski
  2026-11-02 12:49 ` [PATCH net 1/9] xsk: fix list corruption in xsk_buff_add_frag() Maciej Fijalkowski
                   ` (10 more replies)
  0 siblings, 11 replies; 22+ messages in thread
From: Maciej Fijalkowski @ 2026-11-02 12:49 UTC (permalink / raw)
  To: netdev
  Cc: magnus.karlsson, stfomichev, kuba, pabeni, tushar.vyavahare,
	kerneljasonxing, bjorn, zuomao338, Maciej Fijalkowski

Welcome,

Nagato Shiratana reported that duplicate fill ring addresses in aligned
mode let a driver pass the same buffer to xsk_buff_add_frag() twice.
This corrupts pool->xskb_list and can lead to a NULL pointer
dereference in xp_free(). Patch 1 makes xsk_buff_add_frag() reject
such buffers.

Inspecting the rest of the zero-copy multi-buffer code found more
issues:

- i40e retries a freed frame, or stalls the queue on a duplicate, when
  xsk_buff_add_frag() fails (patch 2)
- ice leaks the buffer when a frag is empty or cannot be added (patch 3)
- ice and libeth free the frags of a frame still being received when
  a multi-buffer XDP_TX frame completes (patches 4-5)
- handing out a duplicate of a frame's head clears its frags flag, so
  its frags stay on pool->xskb_list and end up in the next frame
  (patch 6)
- ice and idpf leak a partially received frame on ring cleanup, and
  its frags end up in the next frame (patches 8-9)

Patch 7 is Chenguang Zhao's fix for i40e building broken skbs from
multi-buffer frames. It was posted earlier in an IWL pull request [0]
and is included here unchanged.

Patches 1 and 6 were tested with KUnit tests based on the reporter's
reproducer, plus I verified to-be-upstreamed xsk.py test suite passes
on ice driver (back-to-back setup based on netns) with this set applied.

Thanks,
MF

[0] https://lore.kernel.org/netdev/20260918212458.550425-9-anthony.l.nguyen@intel.com/


Chenguang Zhao (1):
  i40e: xsk: fix multi-buffer XDP_PASS skb construction

Maciej Fijalkowski (8):
  xsk: fix list corruption in xsk_buff_add_frag()
  i40e: xsk: fix xsk_buff_add_frag() error handling in Rx
  ice: xsk: fix leaking Rx buffers in multi-buffer path
  ice: xsk: do not free in-flight frags on XDP_TX completion
  libeth: xsk: do not free in-flight frags on XDP_TX completion
  xsk: do not clear frags flag when acquiring a buffer
  ice: xsk: free stashed Rx frame when cleaning the ring
  idpf: free stashed XSk Rx frame when releasing the queue

 drivers/net/ethernet/intel/i40e/i40e_xsk.c | 35 ++++++++++++----------
 drivers/net/ethernet/intel/ice/ice_xsk.c   | 19 ++++++++++--
 drivers/net/ethernet/intel/idpf/xsk.c      |  5 ++++
 include/net/libeth/xsk.h                   | 10 +++++--
 include/net/xdp_sock_drv.h                 | 11 +++++--
 net/xdp/xsk.c                              |  1 +
 net/xdp/xsk_buff_pool.c                    |  2 +-
 7 files changed, 60 insertions(+), 23 deletions(-)

-- 
2.43.0


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

end of thread, other threads:[~2026-11-03 17:22 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-02 12:49 [PATCH net 0/9] xsk: ZC mbuf fixes Maciej Fijalkowski
2026-11-02 12:49 ` [PATCH net 1/9] xsk: fix list corruption in xsk_buff_add_frag() Maciej Fijalkowski
2026-11-03 13:32   ` netdev-bot+sashiko
2026-11-03 16:24     ` Maciej Fijalkowski
2026-11-02 12:49 ` [PATCH net 2/9] i40e: xsk: fix xsk_buff_add_frag() error handling in Rx Maciej Fijalkowski
2026-11-03 13:32   ` netdev-bot+sashiko
2026-11-03 16:29     ` Maciej Fijalkowski
2026-11-02 12:49 ` [PATCH net 3/9] ice: xsk: fix leaking Rx buffers in multi-buffer path Maciej Fijalkowski
2026-11-03 13:32   ` netdev-bot+sashiko
2026-11-03 17:22     ` Maciej Fijalkowski
2026-11-02 12:49 ` [PATCH net 4/9] ice: xsk: do not free in-flight frags on XDP_TX completion Maciej Fijalkowski
2026-11-02 12:49 ` [PATCH net 5/9] libeth: " Maciej Fijalkowski
2026-11-03 13:32   ` netdev-bot+sashiko
2026-11-02 12:49 ` [PATCH net 6/9] xsk: do not clear frags flag when acquiring a buffer Maciej Fijalkowski
2026-11-03 13:32   ` netdev-bot+sashiko
2026-11-02 12:49 ` [PATCH net 7/9] i40e: xsk: fix multi-buffer XDP_PASS skb construction Maciej Fijalkowski
2026-11-02 12:49 ` [PATCH net 8/9] ice: xsk: free stashed Rx frame when cleaning the ring Maciej Fijalkowski
2026-11-02 12:49 ` [PATCH net 9/9] idpf: free stashed XSk Rx frame when releasing the queue Maciej Fijalkowski
2026-11-03 13:32   ` netdev-bot+sashiko
2026-11-02 12:54 ` [PATCH net 0/9] xsk: ZC mbuf fixes netdev-bot+sinfo
2026-11-02 13:18   ` Maciej Fijalkowski
2026-11-03  4:48 ` Björn Töpel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.