Netdev List
 help / color / mirror / Atom feed
* [PATCH net v2 0/2] octeon_ep, octeon_ep_vf: fix skb frags overflow in the RX path
@ 2026-07-02 18:05 Maoyi Xie
  2026-07-02 18:05 ` [PATCH net v2 1/2] octeon_ep: " Maoyi Xie
  2026-07-02 18:05 ` [PATCH net v2 2/2] octeon_ep_vf: " Maoyi Xie
  0 siblings, 2 replies; 5+ messages in thread
From: Maoyi Xie @ 2026-07-02 18:05 UTC (permalink / raw)
  To: Veerasenareddy Burru, Sathesh Edara
  Cc: Andrew Lunn, David S . Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Maciej Fijalkowski, netdev, linux-kernel

Both octeon_ep and octeon_ep_vf build an skb for a multi-buffer RX packet
by adding one fragment per buffer_size chunk of a device-reported length.
Neither bounds the count against MAX_SKB_FRAGS. A long packet yields about
18 fragments, one past the default MAX_SKB_FRAGS of 17, so
skb_add_rx_frag() writes past shinfo->frags[].

Each driver now checks the fragment count before it builds the skb and
drops a packet that would not fit.

v2:
 - move the check before (napi_)build_skb() so the driver does not build an
   skb only to free it, per Maciej Fijalkowski.
 - the frag count check uses the same u16 length the fragment loop uses.
The repeated linear/non-linear code in octeon_ep_vf that Maciej noted is a
separate cleanup, left for net-next to keep this fix minimal.

v1: https://lore.kernel.org/r/20260701112825.1653044-1-maoyixie.tju@gmail.com


Maoyi Xie (2):
  octeon_ep: fix skb frags overflow in the RX path
  octeon_ep_vf: fix skb frags overflow in the RX path

 .../net/ethernet/marvell/octeon_ep/octep_rx.c |  9 +++++++++
 .../marvell/octeon_ep_vf/octep_vf_rx.c        | 20 +++++++++++++++++++
 2 files changed, 29 insertions(+)

-- 
2.34.1


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

end of thread, other threads:[~2026-07-03 12:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-02 18:05 [PATCH net v2 0/2] octeon_ep, octeon_ep_vf: fix skb frags overflow in the RX path Maoyi Xie
2026-07-02 18:05 ` [PATCH net v2 1/2] octeon_ep: " Maoyi Xie
2026-07-03 12:01   ` Maciej Fijalkowski
2026-07-02 18:05 ` [PATCH net v2 2/2] octeon_ep_vf: " Maoyi Xie
2026-07-03 12:11   ` Maciej Fijalkowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox