From: Jason Gunthorpe <jgg@ziepe.ca>
To: Yili Zhang <zhangyili01@baidu.com>
Cc: leon@kernel.org, linux-rdma@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] RDMA/nldev: Guard against NULL ucontext in resource dumps
Date: Tue, 11 Aug 2026 11:19:09 -0300 [thread overview]
Message-ID: <20260811141909.GF544626@ziepe.ca> (raw)
In-Reply-To: <6a7affdd.5c752b50.b00e6.7ed7SMTPIN_ADDED_BROKEN@mx.google.com>
On Tue, Aug 11, 2026 at 06:56:23PM +0800, Yili Zhang wrote:
> + /*
> + * The uobject's context is cleared by uverbs_destroy_uobject() during
> + * the RDMA_REMOVE_DRIVER_FAILURE fallback path, while the CQ itself is
> + * leaked in the restrack xarray (its destroy failed, so neither the HW
> + * CQ nor the restrack entry can be torn down). A concurrent dump must
> + * not oops when it stumbles onto such a half-destroyed user CQ.
> + */
> + if (!rdma_is_kernel_res(res)) {
> + struct ib_ucontext *ctx =
> + READ_ONCE(cq->uobject->uevent.uobject.context);
> +
> + if (ctx && nla_put_u32(msg, RDMA_NLDEV_ATTR_RES_CTXN,
> + ctx->res.id))
> + return -EMSGSIZE;
> + }
It is missing locking right? This needs to run under the disassociate
srcu probably
Jason
parent reply other threads:[~2026-08-11 14:19 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <6a7affdd.5c752b50.b00e6.7ed7SMTPIN_ADDED_BROKEN@mx.google.com>]
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=20260811141909.GF544626@ziepe.ca \
--to=jgg@ziepe.ca \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=zhangyili01@baidu.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 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.