Skip to content

octeon_ep_vf: fix napi_build_skb() NULL dereference

David Carlier lkml netdev stable 1 version Applied

Status from this message: This series was applied to netdev/net.git (main)

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest2 patches 0 repliesApplied 2/2

Patches in v2 All 2 applied

#Subject and filesSizeRepliesApplied
1/2octeon_ep_vf: introduce octep_vf_oq_next_idx() helperdrivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_rx.c+8 -90 repliesApplied
2/2octeon_ep_vf: add NULL check for napi_build_skb()drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_rx.c+28 -20 repliesApplied

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH net v2 0/2] octeon_ep_vf: fix napi_build_skb() NULL dereference

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(-)
Signature · 1 line
2.53.0