All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: David Carlier <devnexen@gmail.com>
Cc: Veerasenareddy Burru <vburru@marvell.com>,
	Sathesh Edara <sedara@marvell.com>,
	Shinas Rasheed <srasheed@marvell.com>,
	Satananda Burla <sburla@marvell.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	netdev@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] octeon_ep_vf: add NULL check for napi_build_skb()
Date: Wed, 8 Apr 2026 18:02:06 +0100	[thread overview]
Message-ID: <20260408170206.GI469338@kernel.org> (raw)
In-Reply-To: <20260403200732.497307-1-devnexen@gmail.com>

On Fri, Apr 03, 2026 at 09:07:32PM +0100, David Carlier wrote:
> 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.
> 
> Add NULL checks after both napi_build_skb() calls, properly advancing
> descriptors and consuming remaining fragments on failure.
> 
> Fixes: 1cd3b407977c ("octeon_ep_vf: add Tx/Rx processing and interrupt support")
> Cc: stable@vger.kernel.org
> Signed-off-by: David Carlier <devnexen@gmail.com>

Hi David,

I appreciate that this is on the fast path, and thus I expect it
is performance critical. But this patch largely duplicates code
already present in the same function. Would it be possible
refactor things a bit - e.g. using helpers - to make the change
a bit cleaner while not hurting performance?

If so, I'd suggest splitting patch(es) that refactor the code
from the patch that fixes the bug.

...

  reply	other threads:[~2026-04-08 17:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-03 20:07 [PATCH] octeon_ep_vf: add NULL check for napi_build_skb() David Carlier
2026-04-08 17:02 ` Simon Horman [this message]
2026-04-08 17:35   ` David CARLIER

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260408170206.GI469338@kernel.org \
    --to=horms@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=devnexen@gmail.com \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sburla@marvell.com \
    --cc=sedara@marvell.com \
    --cc=srasheed@marvell.com \
    --cc=stable@vger.kernel.org \
    --cc=vburru@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.