The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Shuai Xue <xueshuai@linux.alibaba.com>
To: 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,
	xueshuai@linux.alibaba.com
Subject: [PATCH 0/4] iommu: Fix SVA, iommufd, and iommupt error paths
Date: Sun, 26 Jul 2026 15:43:28 +0800	[thread overview]
Message-ID: <cover.1785050951.git.xueshuai@linux.alibaba.com> (raw)

This series fixes four independent error-path/lifetime issues in the
IOMMU core helpers, iommufd, and generic page table code.

Patch 1 fixes an SVA race where an attach handle becomes visible before
handle->dev is initialized. A racing bind can reuse the handle and later
unbind can dereference a NULL handle->dev.

Patches 2 and 3 fix iommufd reference/lock leaks. Patch 2 avoids taking
an object reference for internal accesses that are skipped by the unmap
notification path. Patch 3 releases the current IOAS rwsem and object
reference if xa_store() fails before the IOAS is inserted into the
unwind list.

Patch 4 fixes the generic page table iova_to_phys() op to return 0 on
range validation failures. Returning a negative errno from a phys_addr_t
function can make callers consume a bogus physical address.

All patches are small fixes with Fixes tags and Cc: stable.

Shuai Xue (4):
  iommu/sva: Set handle->dev before the SVA handle is visible
  iommufd: Avoid locking internal accesses during unmap
  iommufd: Release current IOAS on xa_store() failure
  iommupt: Return zero for invalid iova_to_phys() ranges

 drivers/iommu/generic_pt/iommu_pt.h | 2 +-
 drivers/iommu/iommu-sva.c           | 2 +-
 drivers/iommu/iommufd/device.c      | 4 ++--
 drivers/iommu/iommufd/ioas.c        | 2 ++
 4 files changed, 6 insertions(+), 4 deletions(-)

-- 
2.39.3


             reply	other threads:[~2026-07-26  7:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-26  7:43 Shuai Xue [this message]
2026-07-26  7:43 ` [PATCH 1/4] iommu/sva: Set handle->dev before the SVA handle is visible Shuai Xue
2026-07-26  7:43 ` [PATCH 2/4] iommufd: Avoid locking internal accesses during unmap Shuai Xue
2026-07-26  7:43 ` [PATCH 3/4] iommufd: Release current IOAS on xa_store() failure Shuai Xue
2026-07-26  7:43 ` [PATCH 4/4] iommupt: Return zero for invalid iova_to_phys() ranges Shuai Xue

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=cover.1785050951.git.xueshuai@linux.alibaba.com \
    --to=xueshuai@linux.alibaba.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=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