stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nicolin Chen <nicolinc@nvidia.com>
To: Jason Gunthorpe <jgg@nvidia.com>
Cc: <iommu@lists.linux.dev>,
	Alex Williamson <alex.williamson@redhat.com>,
	"Lu Baolu" <baolu.lu@linux.intel.com>,
	Eric Auger <eric.auger@redhat.com>,
	"Kevin Tian" <kevin.tian@intel.com>,
	Lixiao Yang <lixiao.yang@intel.com>,
	"Matthew Rosato" <mjrosato@linux.ibm.com>,
	<stable@vger.kernel.org>,
	<syzbot+7574ebfe589049630608@syzkaller.appspotmail.com>,
	Terrence Xu <terrence.xu@intel.com>, Yi Liu <yi.l.liu@intel.com>
Subject: Re: [PATCH rc 1/3] iommufd/selftest: Do not try to destroy an access once it is attached
Date: Tue, 25 Jul 2023 14:45:24 -0700	[thread overview]
Message-ID: <ZMBCdNIneapDbjUS@Asurada-Nvidia> (raw)
In-Reply-To: <1-v1-85aacb2af554+bc-iommufd_syz3_jgg@nvidia.com>

On Tue, Jul 25, 2023 at 04:05:48PM -0300, Jason Gunthorpe wrote:
> The access must be detached first.
>
> To make the cleanup simpler copy the fdno to userspace before creating the
> access in the first place. Then there is no need to unwind after
> iommufd_access_attach.
>
> Fixes: 54b47585db66 ("iommufd: Create access in vfio_iommufd_emulated_bind()")
> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>

Hmm, I was expecting that the iopt_remove_access() call in the
iommufd_access_destroy_object() could "detach" the access. If
calling iopt_remove_access() isn't enough, it means that we'd
need the full routine from the iommufd_access_detach() in cdev
series, i.e. we are missing the unmap part?

In that case, though this patch can fix the issue in selftest,
yet does the emulated pathway potentially have the same issue?

Thanks
Nic

  reply	other threads:[~2023-07-25 21:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-25 19:05 [PATCH rc 0/3] Several iommufd bug fixes Jason Gunthorpe
2023-07-25 19:05 ` [PATCH rc 1/3] iommufd/selftest: Do not try to destroy an access once it is attached Jason Gunthorpe
2023-07-25 21:45   ` Nicolin Chen [this message]
2023-07-26  3:53   ` Greg KH
2023-07-25 19:05 ` [PATCH rc 2/3] iommufd: IOMMUFD_DESTROY should not increase the refcount Jason Gunthorpe
2023-07-27  5:25   ` Tian, Kevin
2023-07-27 14:10     ` Jason Gunthorpe
2023-07-25 19:05 ` [PATCH rc 3/3] iommufd: Set end correctly when doing batch carry Jason Gunthorpe
2023-07-25 19:55   ` Nicolin Chen
2023-07-27  5:26   ` Tian, Kevin

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=ZMBCdNIneapDbjUS@Asurada-Nvidia \
    --to=nicolinc@nvidia.com \
    --cc=alex.williamson@redhat.com \
    --cc=baolu.lu@linux.intel.com \
    --cc=eric.auger@redhat.com \
    --cc=iommu@lists.linux.dev \
    --cc=jgg@nvidia.com \
    --cc=kevin.tian@intel.com \
    --cc=lixiao.yang@intel.com \
    --cc=mjrosato@linux.ibm.com \
    --cc=stable@vger.kernel.org \
    --cc=syzbot+7574ebfe589049630608@syzkaller.appspotmail.com \
    --cc=terrence.xu@intel.com \
    --cc=yi.l.liu@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;
as well as URLs for NNTP newsgroup(s).