All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Alexey Kodanev <aleksei.kodanev@bell-sw.com>
Cc: netdev@vger.kernel.org, Byungho An <bh74.an@samsung.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>,
	Girish K S <ks.giri@samsung.com>,
	Siva Reddy <siva.kallam@samsung.com>,
	Vipul Pandya <vipul.pandya@samsung.com>
Subject: Re: [PATCH net] net: sxgbe: fix potential NULL dereference in sxgbe_rx()
Date: Tue, 25 Nov 2025 15:15:49 +0000	[thread overview]
Message-ID: <aSXIJZ3EztBeCfPg@horms.kernel.org> (raw)
In-Reply-To: <20251121123834.97748-1-aleksei.kodanev@bell-sw.com>

On Fri, Nov 21, 2025 at 12:38:34PM +0000, Alexey Kodanev wrote:
> Currently, when skb is null, the driver prints an error and then
> dereferences skb on the next line.
> 
> To fix this, let's add a 'break' after the error message to switch
> to sxgbe_rx_refill(), which is similar to the approach taken by the
> other drivers in this particular case, e.g. calxeda with xgmac_rx().
> 
> Found during a code review.
> 
> Fixes: 1edb9ca69e8a ("net: sxgbe: add basic framework for Samsung 10Gb ethernet driver")
> Signed-off-by: Alexey Kodanev <aleksei.kodanev@bell-sw.com>

Thanks Alexey,

I think this is a case where it is hard to know the true effects
without running the system. But I'm assuming that we aren't in
a position to do so. So instead we need to try to reason at
the code level.

From that perspective I do see that:
1. Without this change there will be a NULL pointer dereference *boob*
2. It seems that the refill logic should work with the proposed solution

So, I do expect this helps.
And I do think it can be accepted without hw testing.
But I do have a lower confidence level than I would if there
was hw testing.

Reviewed-by: Simon Horman <horms@kernel.org>

  reply	other threads:[~2025-11-25 15:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-21 12:38 [PATCH net] net: sxgbe: fix potential NULL dereference in sxgbe_rx() Alexey Kodanev
2025-11-25 15:15 ` Simon Horman [this message]
2025-11-26  3:20 ` patchwork-bot+netdevbpf

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=aSXIJZ3EztBeCfPg@horms.kernel.org \
    --to=horms@kernel.org \
    --cc=aleksei.kodanev@bell-sw.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=bh74.an@samsung.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=ks.giri@samsung.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=siva.kallam@samsung.com \
    --cc=vipul.pandya@samsung.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.