public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net v2 0/2] octeon_ep_vf: fix napi_build_skb() NULL dereference
@ 2026-04-09 18:40 David Carlier
  2026-04-09 18:40 ` [PATCH net v2 1/2] octeon_ep_vf: introduce octep_vf_oq_next_idx() helper David Carlier
  2026-04-09 18:40 ` [PATCH net v2 2/2] octeon_ep_vf: add NULL check for napi_build_skb() David Carlier
  0 siblings, 2 replies; 3+ messages in thread
From: David Carlier @ 2026-04-09 18:40 UTC (permalink / raw)
  To: netdev
  Cc: vburru, sedara, srasheed, sburla, andrew+netdev, davem, edumazet,
	kuba, pabeni, horms, linux-kernel, stable, David Carlier

napi_build_skb() can return NULL on allocation failure. In
__octep_vf_oq_process_rx(), the result is used directly without a
NULL check in both the single-buffer and multi-fragment paths,
leading to a NULL pointer dereference.

Patch 1 introduces a helper to deduplicate the ring index advance
pattern, patch 2 adds the actual NULL checks.

---
v1 -> v2: split into refactor + fix per Simon Horman review.
v1: https://lore.kernel.org/netdev/Z-6w5kfCJoGhb30g@framework/

David Carlier (2):
  octeon_ep_vf: introduce octep_vf_oq_next_idx() helper
  octeon_ep_vf: add NULL check for napi_build_skb()

 .../marvell/octeon_ep_vf/octep_vf_rx.c        | 47 ++++++++++++++-----
 1 file changed, 36 insertions(+), 11 deletions(-)

-- 
2.53.0


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

end of thread, other threads:[~2026-04-09 18:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-09 18:40 [PATCH net v2 0/2] octeon_ep_vf: fix napi_build_skb() NULL dereference David Carlier
2026-04-09 18:40 ` [PATCH net v2 1/2] octeon_ep_vf: introduce octep_vf_oq_next_idx() helper David Carlier
2026-04-09 18:40 ` [PATCH net v2 2/2] octeon_ep_vf: add NULL check for napi_build_skb() David Carlier

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