From: Baolu Lu <baolu.lu@linux.intel.com>
To: Shuai Xue <xueshuai@linux.alibaba.com>,
joro@8bytes.org, will@kernel.org, robin.murphy@arm.com,
jgg@ziepe.ca, kevin.tian@intel.com
Cc: iommu@lists.linux.dev, linux-kernel@vger.kernel.org,
oliver.yang@linux.alibaba.com, zhuo.song@linux.alibaba.com
Subject: Re: [PATCH 1/4] iommu/sva: Set handle->dev before the SVA handle is visible
Date: Wed, 29 Jul 2026 10:59:35 +0800 [thread overview]
Message-ID: <52bff3eb-675c-4b63-a791-5a4e843d787e@linux.intel.com> (raw)
In-Reply-To: <c22e9af74d113b110348b995879baf2fd4734fe7.1785050951.git.xueshuai@linux.alibaba.com>
On 7/26/26 15:43, Shuai Xue wrote:
> iommu_attach_device_pasid() installs the new SVA attach handle in the
> group PASID lookup before iommu_sva_bind_device() returns. A concurrent
> bind can therefore find and reuse the same handle after iommu_sva_lock is
> dropped.
>
> handle->dev was initialized after dropping iommu_sva_lock. This leaves a
> window where a racing bind can return a handle whose dev pointer is still
> NULL. A subsequent iommu_sva_unbind_device() can then dereference it via
> handle->dev->iommu_group.
>
> Initialize handle->dev before releasing iommu_sva_lock so any visible SVA
> handle is fully initialized.
>
> Fixes: be51b1d6bbff ("iommu/sva: Refactoring iommu_sva_bind/unbind_device()")
> Cc:stable@vger.kernel.org
> Assisted-by:Qoder:Qwen-3.8-MAX-Preview
> Signed-off-by: Shuai Xue<xueshuai@linux.alibaba.com>
> ---
> drivers/iommu/iommu-sva.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com>
next prev parent reply other threads:[~2026-07-29 3:01 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-26 7:43 [PATCH 0/4] iommu: Fix SVA, iommufd, and iommupt error paths Shuai Xue
2026-07-26 7:43 ` [PATCH 1/4] iommu/sva: Set handle->dev before the SVA handle is visible Shuai Xue
2026-07-27 9:38 ` Tian, Kevin
2026-07-27 10:14 ` Shuai Xue
2026-07-29 2:59 ` Baolu Lu [this message]
2026-07-26 7:43 ` [PATCH 2/4] iommufd: Avoid locking internal accesses during unmap Shuai Xue
2026-07-27 9:38 ` Tian, Kevin
2026-07-26 7:43 ` [PATCH 3/4] iommufd: Release current IOAS on xa_store() failure Shuai Xue
2026-07-27 9:39 ` Tian, Kevin
2026-07-26 7:43 ` [PATCH 4/4] iommupt: Return zero for invalid iova_to_phys() ranges Shuai Xue
2026-07-27 9:39 ` Tian, Kevin
2026-07-29 2:59 ` Baolu Lu
2026-08-07 22:45 ` [PATCH 0/4] iommu: Fix SVA, iommufd, and iommupt error paths Jason Gunthorpe
2026-08-10 7:52 ` Jörg Rödel
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=52bff3eb-675c-4b63-a791-5a4e843d787e@linux.intel.com \
--to=baolu.lu@linux.intel.com \
--cc=iommu@lists.linux.dev \
--cc=jgg@ziepe.ca \
--cc=joro@8bytes.org \
--cc=kevin.tian@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=oliver.yang@linux.alibaba.com \
--cc=robin.murphy@arm.com \
--cc=will@kernel.org \
--cc=xueshuai@linux.alibaba.com \
--cc=zhuo.song@linux.alibaba.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
Powered by JetHome