Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Kamal Heib <kheib@redhat.com>
Cc: linux-rdma@vger.kernel.org,
	Abhijit Gangurde <abhijit.gangurde@amd.com>,
	Allen Hubbe <allen.hubbe@amd.com>, Jason Gunthorpe <jgg@ziepe.ca>
Subject: Re: [PATCH rdma-rc 0/2] RDMA/ionic: Fix NULL pointer dereferences
Date: Mon, 13 Jul 2026 12:17:33 +0300	[thread overview]
Message-ID: <20260713091733.GJ33197@unreal> (raw)
In-Reply-To: <alPrQa9ZgDaGuPYo@lima-fedora43>

On Sun, Jul 12, 2026 at 03:30:09PM -0400, Kamal Heib wrote:
> On Sun, Jul 12, 2026 at 12:13:26PM +0300, Leon Romanovsky wrote:
> > On Thu, Jul 09, 2026 at 06:03:51PM -0400, Kamal Heib wrote:
> > > Fix two potential NULL pointer dereferences in the ionic driver by
> > > adding the missing NULL checks before dereferencing netdev pointers.
> > 
> > How is it possible to have ionic IB driver without netdev?
> > 
> > Thanks
> >
> 
> Thanks for your review, after taking a deeper look:
> 
> For Patch 2 (ionic_create_ibdev): You are right. Since lif is embedded in
> netdev via netdev_priv() and they are allocated/freed together,
> lif->netdev cannot be NULL if lif is valid, Please drop this patch.
> 
> For Patch 1 (ionic_query_device): This one should remain.
> ib_device_get_netdev() is a core RDMA API that explicitly returns NULL in
> multiple code paths:
> 
> - Invalid port: if (!rdma_is_port_valid(ib_dev, port)) return NULL;
> - No port_data: if (!ib_dev->port_data) return NULL;
> - NULL netdev pointer stored in port_data
> 
> Also, the return value from ib_device_get_netdev() is being checked in
> multiple places in both drivers and the RDMA core.
> 
> Let me know what you think?

I think that you shouldn't copy/paste answers from your favorite AI tool.

Thanks

> 
> Thanks,
> Kamal
> 
> > > 
> > > Kamal Heib (2):
> > >   RDMA/ionic: Fix potential NULL pointer dereference in
> > >     ionic_query_device
> > >   RDMA/ionic: Fix potential NULL pointer dereference in
> > >     ionic_create_ibdev
> > > 
> > >  drivers/infiniband/hw/ionic/ionic_ibdev.c | 8 ++++++++
> > >  1 file changed, 8 insertions(+)
> > > 
> > > -- 
> > > 2.55.0
> > > 
> > > 
> > 
> 

  reply	other threads:[~2026-07-13  9:17 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-09 22:03 [PATCH rdma-rc 0/2] RDMA/ionic: Fix NULL pointer dereferences Kamal Heib
2026-07-09 22:03 ` [PATCH rdma-rc 1/2] RDMA/ionic: Fix potential NULL pointer dereference in ionic_query_device Kamal Heib
2026-07-09 22:03   ` [PATCH rdma-rc 2/2] RDMA/ionic: Fix potential NULL pointer dereference in ionic_create_ibdev Kamal Heib
2026-07-10  6:28     ` Kalesh Anakkur Purayil
2026-07-10  5:55   ` [PATCH rdma-rc 1/2] RDMA/ionic: Fix potential NULL pointer dereference in ionic_query_device Kalesh Anakkur Purayil
2026-07-12  9:13 ` [PATCH rdma-rc 0/2] RDMA/ionic: Fix NULL pointer dereferences Leon Romanovsky
2026-07-12 19:30   ` Kamal Heib
2026-07-13  9:17     ` Leon Romanovsky [this message]
2026-07-13 11:12       ` Kamal Heib
2026-07-13 11:35         ` Leon Romanovsky
2026-07-13 12:41           ` Kamal Heib
2026-07-13 12:50             ` Jason Gunthorpe
2026-07-13 14:07             ` Leon Romanovsky

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=20260713091733.GJ33197@unreal \
    --to=leon@kernel.org \
    --cc=abhijit.gangurde@amd.com \
    --cc=allen.hubbe@amd.com \
    --cc=jgg@ziepe.ca \
    --cc=kheib@redhat.com \
    --cc=linux-rdma@vger.kernel.org \
    /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