From: Leon Romanovsky <leon@kernel.org>
To: Jason Gunthorpe <jgg@nvidia.com>
Cc: Gal Pressman <gal.pressman@linux.dev>,
Krzysztof Czurylo <krzysztof.czurylo@intel.com>,
linux-rdma@vger.kernel.org, Michael Margolin <mrgolin@amazon.com>,
Yossi Leybovich <sleybo@amazon.com>,
Tatyana Nikolova <tatyana.e.nikolova@intel.com>,
Abhijit Gangurde <abhijit.gangurde@amd.com>,
Allen Hubbe <allen.hubbe@amd.com>,
Andrew Boyer <andrew.boyer@amd.com>,
Gal Pressman <galpress@amazon.com>,
Mustafa Ismail <mustafa.ismail@intel.com>,
patches@lists.linux.dev, Roland Dreier <rolandd@cisco.com>,
Shiraz Saleem <shiraz.saleem@intel.com>,
stable@vger.kernel.org, Steve Wise <swise@opengridcomputing.com>
Subject: Re: [PATCH rc 2/4] IB/mthca: Add missed mthca_unmap_user_db() for mthca_create_srq()
Date: Tue, 17 Feb 2026 15:23:56 +0200 [thread overview]
Message-ID: <20260217132356.GM12989@unreal> (raw)
In-Reply-To: <2-v1-83e918d69e73+a9-rdma_udata_rc_jgg@nvidia.com>
On Mon, Feb 16, 2026 at 11:02:48AM -0400, Jason Gunthorpe wrote:
> Fix a user triggerable leak on the system call failure path.
>
> Cc: stable@vger.kernel.org
> Fixes: ec34a922d243 ("[PATCH] IB/mthca: Add SRQ implementation")
> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
> ---
> drivers/infiniband/hw/mthca/mthca_provider.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/infiniband/hw/mthca/mthca_provider.c b/drivers/infiniband/hw/mthca/mthca_provider.c
> index dd572d76866c2e..ae0c8024ad2310 100644
> --- a/drivers/infiniband/hw/mthca/mthca_provider.c
> +++ b/drivers/infiniband/hw/mthca/mthca_provider.c
> @@ -428,6 +428,8 @@ static int mthca_create_srq(struct ib_srq *ibsrq,
>
> if (context && ib_copy_to_udata(udata, &srq->srqn, sizeof(__u32))) {
> mthca_free_srq(to_mdev(ibsrq->device), srq);
> + mthca_unmap_user_db(to_mdev(ibsrq->device), &context->uar,
> + context->db_tab, ucmd.db_index);
> return -EFAULT;
> }
The `mthca_destroy_srq()` implementation needs to be corrected as well.
Its resource release order is currently reversed.
Thanks
>
> --
> 2.43.0
>
next prev parent reply other threads:[~2026-02-17 13:23 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-16 15:02 [PATCH rc 0/4] Fix several serious mistakes on the udata path in drivers Jason Gunthorpe
2026-02-16 15:02 ` [PATCH rc 1/4] RDMA/efa: Fix typo in efa_alloc_mr() Jason Gunthorpe
2026-02-16 15:30 ` Michael Margolin
2026-02-16 15:02 ` [PATCH rc 2/4] IB/mthca: Add missed mthca_unmap_user_db() for mthca_create_srq() Jason Gunthorpe
2026-02-17 13:23 ` Leon Romanovsky [this message]
2026-02-17 23:46 ` Jason Gunthorpe
2026-02-18 9:06 ` Leon Romanovsky
2026-02-16 15:02 ` [PATCH rc 3/4] RDMA/irdma: Fix kernel stack leak in irdma_create_user_ah() Jason Gunthorpe
2026-02-16 15:02 ` [PATCH rc 4/4] RDMA/ionic: Fix kernel stack leak in ionic_create_cq() Jason Gunthorpe
2026-02-23 12:07 ` Abhijit Gangurde
2026-02-24 10:03 ` [PATCH rc 0/4] Fix several serious mistakes on the udata path in drivers Leon Romanovsky
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=20260217132356.GM12989@unreal \
--to=leon@kernel.org \
--cc=abhijit.gangurde@amd.com \
--cc=allen.hubbe@amd.com \
--cc=andrew.boyer@amd.com \
--cc=gal.pressman@linux.dev \
--cc=galpress@amazon.com \
--cc=jgg@nvidia.com \
--cc=krzysztof.czurylo@intel.com \
--cc=linux-rdma@vger.kernel.org \
--cc=mrgolin@amazon.com \
--cc=mustafa.ismail@intel.com \
--cc=patches@lists.linux.dev \
--cc=rolandd@cisco.com \
--cc=shiraz.saleem@intel.com \
--cc=sleybo@amazon.com \
--cc=stable@vger.kernel.org \
--cc=swise@opengridcomputing.com \
--cc=tatyana.e.nikolova@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox