netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@ziepe.ca>
To: Leon Romanovsky <leon@kernel.org>
Cc: Chenguang Zhao <chenguang.zhao@linux.dev>,
	andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com,
	kuba@kernel.org, pabeni@redhat.com, linux-rdma@vger.kernel.org,
	netdev@vger.kernel.org, tariqt@nvidia.com, mbloch@nvidia.com,
	dtatulea@nvidia.com, shayd@nvidia.com, moshe@nvidia.com,
	Chenguang Zhao <zhaochenguang@kylinos.cn>
Subject: Re: [PATCH rdma-next v3] RDMA/mlx5: quiesce CQ polling before device shutdown on reboot
Date: Fri, 7 Aug 2026 14:48:30 -0300	[thread overview]
Message-ID: <20260807174830.GF200537@ziepe.ca> (raw)
In-Reply-To: <20260716105008.GD357857@unreal>

On Thu, Jul 16, 2026 at 01:50:08PM +0300, Leon Romanovsky wrote:
> On Thu, Jul 16, 2026 at 05:03:37PM +0800, Chenguang Zhao wrote:
> > Hi, Leon
> > reboot -f skips orderly shutdown and goes directly to:
> > 
> > kernel_restart_prepare() -> device_shutdown() -> mlx5 shutdown
> > Upper layers may still hold live CQs, while ib-comp-wq keeps
> > polling — a use-after-free race.
> 
> The point is that this flow is neither RDMA- nor mlx5-specific, and it
> works as expected. mlx5 shutdown() stops the FW/HW, while the kernel
> stops and tears down the running threads.

I'm pretty sure we are missing stuff in the driver to synchronize
everything while it is doing a tear down or health recovery.

Ripping a driver out from under a still-running subsystem is hard,
this does seem like a real bug, but I also don't think the shutdown
handler is the right place to fix it..

What was the actual UAF scenario, we should take a look at that more
directly?

Jason

      reply	other threads:[~2026-08-07 17:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-15  8:23 [PATCH rdma-next v3] RDMA/mlx5: quiesce CQ polling before device shutdown on reboot Chenguang Zhao
2026-07-16  8:42 ` Leon Romanovsky
2026-07-16  9:03   ` Chenguang Zhao
2026-07-16 10:50     ` Leon Romanovsky
2026-08-07 17:48       ` Jason Gunthorpe [this message]

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=20260807174830.GF200537@ziepe.ca \
    --to=jgg@ziepe.ca \
    --cc=andrew+netdev@lunn.ch \
    --cc=chenguang.zhao@linux.dev \
    --cc=davem@davemloft.net \
    --cc=dtatulea@nvidia.com \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=leon@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=mbloch@nvidia.com \
    --cc=moshe@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=shayd@nvidia.com \
    --cc=tariqt@nvidia.com \
    --cc=zhaochenguang@kylinos.cn \
    /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).