All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Parav Pandit <parav@mellanox.com>
Cc: Roman Gushchin <roman.gushchin@linux.dev>,
	Leon Romanovsky <leon@kernel.org>,
	Maher Sanalla <msanalla@nvidia.com>,
	"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] RDMA/core: fix a NULL-pointer dereference in hw_stat_device_show()
Date: Fri, 21 Feb 2025 13:43:47 -0400	[thread overview]
Message-ID: <20250221174347.GA314593@nvidia.com> (raw)
In-Reply-To: <CY8PR12MB7195F3ACB8CFA05C4B8D26D3DCC72@CY8PR12MB7195.namprd12.prod.outlook.com>

On Fri, Feb 21, 2025 at 04:34:25AM +0000, Parav Pandit wrote:

> I just tried reproducing now on 6.12+ kernel manually.
> It appears impossible to reach flow to me as intended in the commit
> I listed.

It looks to me like this:

static void rdma_init_coredev(struct ib_core_device *coredev,
			      struct ib_device *dev, struct net *net)
{
	coredev->dev.groups = dev->groups;
                   ^^^^^^^^^^^^^^^^^^^^^

Copies the sysfs groups from the normal ib_dev which includes the hw_*
stuff to the per-NS device?

Everything in that groups list must use rdma_device_to_ibdev()

int ib_setup_device_attrs(struct ib_device *ibdev)
{
[..]
		attr->attr.show = hw_stat_device_show;
		attr->show = show_hw_stats;
		data->group.attrs[pos] = &attr->attr.attr;
[..]
			ibdev->groups[i] = &data->group;

Which means the sysfs reported here is in that list?

Maybe this was misses when the sysfs was shut off?

Jason

  parent reply	other threads:[~2025-02-21 17:43 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-21  2:05 [PATCH] RDMA/core: fix a NULL-pointer dereference in hw_stat_device_show() Roman Gushchin
2025-02-21  3:14 ` Parav Pandit
2025-02-21  4:25   ` Roman Gushchin
2025-02-21  4:34     ` Parav Pandit
2025-02-21  4:49       ` Roman Gushchin
2025-02-21  8:03         ` Parav Pandit
2025-02-21 20:02           ` Roman Gushchin
2025-02-22 18:36             ` Parav Pandit
2025-02-22 20:50               ` Roman Gushchin
2025-02-21 17:43       ` Jason Gunthorpe [this message]
2025-02-22 18:34         ` Parav Pandit
2025-02-24 15:11           ` Jason Gunthorpe
2025-02-24 15:16             ` Parav Pandit
2025-02-24 23:22               ` Roman Gushchin
2025-02-24 23:30                 ` Jason Gunthorpe
2025-02-25  3:42                   ` Roman Gushchin
2025-02-25  4:34                     ` Parav Pandit
2025-02-26  3:41                       ` Roman Gushchin
2025-02-25 13:16                     ` Jason Gunthorpe
2025-02-26  3:37                       ` Roman Gushchin
2025-02-24 23:31               ` Jason Gunthorpe
2025-02-25 10:38                 ` Parav Pandit

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=20250221174347.GA314593@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=leon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=msanalla@nvidia.com \
    --cc=parav@mellanox.com \
    --cc=roman.gushchin@linux.dev \
    /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.