mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
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 4/4] iommupt: Return zero for invalid iova_to_phys() ranges
Date: Wed, 29 Jul 2026 10:59:52 +0800	[thread overview]
Message-ID: <a28064f2-b302-46e3-9438-45d83092167e@linux.intel.com> (raw)
In-Reply-To: <90a86345b06d43437592da48f1d624c748c4d4ad.1785050951.git.xueshuai@linux.alibaba.com>

On 7/26/26 15:43, Shuai Xue wrote:
> DOMAIN_NS(iova_to_phys) returns a phys_addr_t and follows the IOMMU
> iova_to_phys() convention of returning 0 when there is no valid
> translation.
> 
> make_range() returns a negative errno if the input IOVA cannot be
> represented by this page table format. Returning that errno directly
> casts it to phys_addr_t. Callers treat zero as no translation and use
> non-zero values as physical addresses, so this can make them consume a
> bogus physical address instead of seeing a failed translation.
> 
> Match the page-table walk failure path and return 0 for range validation
> failures too.
> 
> Fixes: 9d4c274cd7d5 ("iommupt: Add iova_to_phys op")
> Cc:stable@vger.kernel.org
> Assisted-by:Qoder:Qwen-3.8-MAX-Preview
> Signed-off-by: Shuai Xue<xueshuai@linux.alibaba.com>
> ---
>   drivers/iommu/generic_pt/iommu_pt.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com>

  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
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 [this message]
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=a28064f2-b302-46e3-9438-45d83092167e@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