All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nicolin Chen <nicolinc@nvidia.com>
To: Lu Baolu <baolu.lu@linux.intel.com>,
	Kevin Tian <kevin.tian@intel.com>, "Yi Liu" <yi.l.liu@intel.com>
Cc: Jason Gunthorpe <jgg@nvidia.com>, <joro@8bytes.org>,
	Will Deacon <will@kernel.org>,
	Robin Murphy <robin.murphy@arm.com>,
	Jean-Philippe Brucker <jpb@kernel.org>, <iommu@lists.linux.dev>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v1 0/4] iommu: Fix attach handle publication ordering
Date: Wed, 28 Oct 2026 11:58:21 -0700	[thread overview]
Message-ID: <auJFzc8CRR+OcLtt@nvidia.com> (raw)
In-Reply-To: <cover.1790718296.git.nicolinc@nvidia.com>

On Tue, Sep 29, 2026 at 02:51:50PM -0700, Nicolin Chen wrote:
> Jason pointed out an issue in the attach handle replacing path:
> https://lore.kernel.org/linux-iommu/20260923233920.GJ2545495@nvidia.com/
> 
> When an attachment is detached or replaced, the IOMMU core can still leave
> the outgoing attach handle published while calling into the driver. A fault
> report looks up the handle without the group mutex, so it can find the old
> handle after the driver's fault flush and just before the caller frees it.
> 
> These four patches unpublish the outgoing handle before a driver callback
> for both group and PASID detach and replace operations. Both replace paths
> store XA_ZERO_ENTRY to reserve the slot and restore the old entry on error.
> 
> This blocks new lookups, but does not retire a fault that already obtained
> the old handle. The driver must still synchronize those readers before the
> handle is freed. A same-domain replacement skips the driver callback, so it
> still needs a separate lifetime mechanism or fence.
> 
> This is on GitHub:
> https://github.com/nicolinc/iommufd/commits/fix_iommu_attach_handle-v1
> 
> Nicolin Chen (4):
>   iommu: Unpublish the attach handle before the group detach callback
>   iommu: Unpublish the attach handle before the PASID detach callback
>   iommu: Unpublish the old attach handle before the group replace
>     callback
>   iommu: Unpublish the old attach handle before the PASID replace
>     callback

Baolu/Kevin/Yi,

Would it be possible for you to take a look at these fixes?

Thanks
Nicolin

  parent reply	other threads:[~2026-10-28 18:58 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-29 21:51 [PATCH v1 0/4] iommu: Fix attach handle publication ordering Nicolin Chen
2026-09-29 21:51 ` [PATCH v1 1/4] iommu: Unpublish the attach handle before the group detach callback Nicolin Chen
2026-10-29  7:18   ` Tian, Kevin
2026-09-29 21:51 ` [PATCH v1 2/4] iommu: Unpublish the attach handle before the PASID " Nicolin Chen
2026-10-29  7:18   ` Tian, Kevin
2026-09-29 21:51 ` [PATCH v1 3/4] iommu: Unpublish the old attach handle before the group replace callback Nicolin Chen
2026-10-29  7:25   ` Tian, Kevin
2026-10-29 11:00     ` Yi Liu
2026-10-29 18:45       ` Jason Gunthorpe
2026-09-29 21:51 ` [PATCH v1 4/4] iommu: Unpublish the old attach handle before the PASID " Nicolin Chen
2026-10-29  7:26   ` Tian, Kevin
2026-10-28 18:58 ` Nicolin Chen [this message]
2026-10-29 11:00 ` [PATCH v1 0/4] iommu: Fix attach handle publication ordering Yi Liu

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=auJFzc8CRR+OcLtt@nvidia.com \
    --to=nicolinc@nvidia.com \
    --cc=baolu.lu@linux.intel.com \
    --cc=iommu@lists.linux.dev \
    --cc=jgg@nvidia.com \
    --cc=joro@8bytes.org \
    --cc=jpb@kernel.org \
    --cc=kevin.tian@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=will@kernel.org \
    --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 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.