All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Yuho Choi <oss.patchbox@gmail.com>
Cc: Jason Gunthorpe <jgg@ziepe.ca>, Yishai Hadas <yishaih@nvidia.com>,
	linux-rdma@vger.kernel.org
Subject: Re: RDMA/mlx5: question about a failed destroy in the SRQ create error path
Date: Tue, 3 Nov 2026 13:58:25 +0200	[thread overview]
Message-ID: <20261103115825.GE264423@unreal> (raw)
In-Reply-To: <20261028053903.209809-2-oss.patchbox@gmail.com>

On Wed, Oct 28, 2026 at 01:38:57AM -0400, Yuho Choi wrote:
> Hi Leon,
> 
> I have a question about the error path of mlx5_ib_create_srq() (rdma
> for-next, c3e8e9451e6f) and would appreciate your view. When copying
> the response to user space fails, the result of the destroy is not
> checked:
> 
> 	err_core:
> 		mlx5_cmd_destroy_srq(dev, &srq->msrq);
> 
> 	err_usr_kern_srq:
> 		if (udata)
> 			destroy_srq_user(ib_srq->pd, srq, udata);
> 
> If I read it correctly, a failed destroy here would leave the firmware
> SRQ using the SRQ buffer and doorbell record that are then released.
> Since fd89099d635e ("RDMA/mlx5: Issue FW command to destroy SRQ on
> reentry") the SRQ would also be back in dev->srq_table after the core
> frees the ib_srq, so SRQ events and ODP page faults (odp_get_rsc())
> could find freed memory.
> 
> Thanks for explaining in [1] that DESTROY of kernel-owned objects does
> not fail on working firmware. I wondered whether user SRQs might be
> different, since they carry the uid of their context and a DEVX QP of
> the same uid can use them, which 43d781b9fa56 ("RDMA: Allow fail of
> destroy CQ") mentions as a reason for destroy to fail. For example,
> could user space create such a DEVX QP on the new SRQ number (probing
> for it) 

Userspace does not control QP numbers; firmware assigns them. If firmware
considers a number to be in use, neither the kernel nor userspace can obtain it.

Thanks

      parent reply	other threads:[~2026-11-03 11:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-28  5:38 RDMA/mlx5: question about a failed destroy in the SRQ create error path Yuho Choi
2026-10-28  5:53 ` sashiko-bot
2026-11-03 11:58 ` Leon Romanovsky [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=20261103115825.GE264423@unreal \
    --to=leon@kernel.org \
    --cc=jgg@ziepe.ca \
    --cc=linux-rdma@vger.kernel.org \
    --cc=oss.patchbox@gmail.com \
    --cc=yishaih@nvidia.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.