From: Jason Gunthorpe <jgg@ziepe.ca>
To: Leon Romanovsky <leon@kernel.org>
Cc: Jaeyeong Lee <lee@jaeyeong.cc>,
Artemy Kovalyov <artemyko@mellanox.com>,
Yishai Hadas <yishaih@mellanox.com>,
linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH v3] RDMA/mlx5: Preserve DEVX objects after failed output copy
Date: Tue, 1 Dec 2026 13:16:30 -0400 [thread overview]
Message-ID: <20261201171630.GK1856591@ziepe.ca> (raw)
In-Reply-To: <20261201153000.GG31440@unreal>
On Tue, Dec 01, 2026 at 05:30:00PM +0200, Leon Romanovsky wrote:
> On Fri, Nov 27, 2026 at 03:10:55AM +0000, Jaeyeong Lee wrote:
> > A DEVX create command can succeed before indirect mkey registration or
> > copying the command output to userspace fails. The current unwind path
> > destroys the hardware object directly, ignores a destroy failure, and
> > frees struct devx_obj.
> >
> > If the object cannot be destroyed,
>
> How can this happen? This is exactly why your reproducer is invalid, it
> does not account for how real hardware behaves.
It definately can happen, I gave an example intending him to paste it
over..
You can create a PD with devx, stall the kernel thread through various
well known means and then make the copy fail.
During the stall you guess the PDN and create a MR within it.
Now FW will not destroy the object due to its refcounting.
There are probably many examples beyond this.
The patch looks OK to me and the code now matches how this was
expected to be used, with finalize preceeding a manual copy to user.
Jason
prev parent reply other threads:[~2026-12-01 17:16 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-11 10:53 [PATCH] RDMA/mlx5: Fix UAF after DEVX DCT create failure Jaeyeong Lee
2026-11-15 13:51 ` Leon Romanovsky
2026-11-22 10:37 ` [PATCH v2] RDMA/mlx5: Preserve DEVX objects after failed output copy Jaeyeong Lee
2026-11-22 10:39 ` Jaeyeong Lee
2026-11-25 13:12 ` Leon Romanovsky
2026-11-25 14:56 ` Jason Gunthorpe
2026-11-27 3:10 ` [PATCH v3] " Jaeyeong Lee
2026-12-01 15:30 ` Leon Romanovsky
2026-12-01 17:16 ` 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=20261201171630.GK1856591@ziepe.ca \
--to=jgg@ziepe.ca \
--cc=artemyko@mellanox.com \
--cc=lee@jaeyeong.cc \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=yishaih@mellanox.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
all inboxes | Powered by JetHome®