From: Simon Horman <horms@kernel.org>
To: Shinas Rasheed <srasheed@marvell.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
hgani@marvell.com, sedara@marvell.com, vimleshk@marvell.com,
wizhao@redhat.com, kongyen@redhat.com, pabeni@redhat.com,
kheib@redhat.com, mschmidt@redhat.com,
Veerasenareddy Burru <vburru@marvell.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>,
Satananda Burla <sburla@marvell.com>,
Abhijit Ayarekar <aayarekar@marvell.com>
Subject: Re: [PATCH net v1 2/3] octeon_ep: add checks to fix NULL pointer dereferences
Date: Tue, 5 Nov 2024 12:25:16 +0000 [thread overview]
Message-ID: <20241105122516.GA4507@kernel.org> (raw)
In-Reply-To: <20241101103416.1064930-3-srasheed@marvell.com>
On Fri, Nov 01, 2024 at 03:34:14AM -0700, Shinas Rasheed wrote:
> Add Checks to avoid NULL pointer references that might
> happen in rare and corner cases
>
> Fixes: 6a610a46bad1 ("octeon_ep: add support for ndo ops")
> Fixes: 1f2c2d0cee02 ("octeon_ep: add hardware configuration APIs")
> Fixes: 0807dc76f3bf ("octeon_ep: support Octeon CN10K devices")
Hi Shinas,
As this has both three Fixes tags and three hunks, I suspect
it is fixing three separate but similar problems. And if so,
would be best split into three patches, one patch per problem.
Further, as an overall comment for the entire series, I think more
explanation of how these problems can arise is needed. Are they race
conditions, artifacts of tear-down or error handling, ... And what
execution paths lead to them? Stack traces, if available, would also be
useful to include.
> Signed-off-by: Shinas Rasheed <srasheed@marvell.com>
> ---
> drivers/net/ethernet/marvell/octeon_ep/octep_cn9k_pf.c | 9 ++++++++-
> drivers/net/ethernet/marvell/octeon_ep/octep_cnxk_pf.c | 9 ++++++++-
> drivers/net/ethernet/marvell/octeon_ep/octep_main.c | 3 +++
> 3 files changed, 19 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/marvell/octeon_ep/octep_cn9k_pf.c b/drivers/net/ethernet/marvell/octeon_ep/octep_cn9k_pf.c
> index b5805969404f..b87336b2e4b9 100644
> --- a/drivers/net/ethernet/marvell/octeon_ep/octep_cn9k_pf.c
> +++ b/drivers/net/ethernet/marvell/octeon_ep/octep_cn9k_pf.c
> @@ -617,7 +617,14 @@ static irqreturn_t octep_rsvd_intr_handler_cn93_pf(void *dev)
> static irqreturn_t octep_ioq_intr_handler_cn93_pf(void *data)
> {
> struct octep_ioq_vector *vector = (struct octep_ioq_vector *)data;
> - struct octep_oq *oq = vector->oq;
> + struct octep_oq *oq;
> +
> + if (!vector)
> + return IRQ_HANDLED;
> + oq = vector->oq;
> +
> + if (!oq || !(oq->napi))
nit: I don't think you need parentheses around op->napi. Likeiwse in patch 3/3.
> + return IRQ_HANDLED;
>
> napi_schedule_irqoff(oq->napi);
> return IRQ_HANDLED;
...
--
pw-bot: changes-requested
next prev parent reply other threads:[~2024-11-05 12:25 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-01 10:34 [PATCH net v1 0/3] Double free fixes and NULL pointer checks Shinas Rasheed
2024-11-01 10:34 ` [PATCH net v1 1/3] octeon_ep: Add checks to fix double free crashes Shinas Rasheed
2024-11-01 10:34 ` [PATCH net v1 2/3] octeon_ep: add checks to fix NULL pointer dereferences Shinas Rasheed
2024-11-05 12:25 ` Simon Horman [this message]
2024-11-01 10:34 ` [PATCH net v1 3/3] octeon_ep_vf: " Shinas Rasheed
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=20241105122516.GA4507@kernel.org \
--to=horms@kernel.org \
--cc=aayarekar@marvell.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hgani@marvell.com \
--cc=kheib@redhat.com \
--cc=kongyen@redhat.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mschmidt@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sburla@marvell.com \
--cc=sedara@marvell.com \
--cc=srasheed@marvell.com \
--cc=vburru@marvell.com \
--cc=vimleshk@marvell.com \
--cc=wizhao@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).