All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH 2/2] RDMA/nldev: Guard against NULL ucontext in resource dumps
       [not found] ` <6a7affdd.5c752b50.b00e6.7ed7SMTPIN_ADDED_BROKEN@mx.google.com>
@ 2026-08-11 14:19   ` Jason Gunthorpe
  0 siblings, 0 replies; only message in thread
From: Jason Gunthorpe @ 2026-08-11 14:19 UTC (permalink / raw)
  To: Yili Zhang; +Cc: leon, linux-rdma, linux-kernel

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-08-11 14:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20260811105623.48633-1-xVq3SwEoxhQs281bogBL>
     [not found] ` <6a7affdd.5c752b50.b00e6.7ed7SMTPIN_ADDED_BROKEN@mx.google.com>
2026-08-11 14:19   ` [PATCH 2/2] RDMA/nldev: Guard against NULL ucontext in resource dumps Jason Gunthorpe

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.