The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Fan Wu <fanwu01@zju.edu.cn>
Cc: linux-rdma@vger.kernel.org, bharat@chelsio.com,
	larrystevenwise@gmail.com, leon@kernel.org, dledford@redhat.com,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH 1/2] RDMA/cxgb4: Cancel reg_work before freeing device on remove
Date: Tue, 11 Aug 2026 17:02:17 -0300	[thread overview]
Message-ID: <20260811200217.GA664971@nvidia.com> (raw)
In-Reply-To: <20260806130128.465460-1-fanwu01@zju.edu.cn>

On Thu, Aug 06, 2026 at 01:01:27PM +0000, Fan Wu wrote:
> c4iw_uld_state_change() queues reg_work to register the RDMA device.
> c4iw_remove() can free ctx->dev while this work is pending or running,
> leaving c4iw_register_device() accessing the freed device.
> 
> Cancel reg_work before removing the device.  The registration work can
> tear down ctx->dev when registration fails, so do not unregister or
> deallocate it again in that case.
> 
> This issue was found by an in-house static analysis tool.
> 
> Fixes: 1c8f1da5d851 ("iw_cxgb4: Fix possible circular dependency locking warning")
> Cc: stable@vger.kernel.org
> Assisted-by: Codex:gpt-5.6
> Signed-off-by: Fan Wu <fanwu01@zju.edu.cn>
> ---
>  drivers/infiniband/hw/cxgb4/device.c | 6 ++++++
>  1 file changed, 6 insertions(+)

applied thanks, the sashiko review also noted a number of pre-existing
issues that seem easy to fix

Jason

      parent reply	other threads:[~2026-08-11 20:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-06 13:01 [PATCH 1/2] RDMA/cxgb4: Cancel reg_work before freeing device on remove Fan Wu
2026-08-06 13:01 ` [PATCH 2/2] RDMA/cxgb4: Free debugfs on registration failure Fan Wu
2026-08-11 20:02 ` 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=20260811200217.GA664971@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=bharat@chelsio.com \
    --cc=dledford@redhat.com \
    --cc=fanwu01@zju.edu.cn \
    --cc=larrystevenwise@gmail.com \
    --cc=leon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=stable@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