mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vasant Hegde <vasant.hegde@amd.com>
To: Guanghui Feng <guanghuifeng@linux.alibaba.com>,
	joro@8bytes.org, suravee.suthikulpanit@amd.com, will@kernel.org,
	robin.murphy@arm.com
Cc: iommu@lists.linux.dev, linux-kernel@vger.kernel.org, ming.shu@amd.com
Subject: Re: [PATCH 1/2] iommu/amd: Fix illegal device-id access in IOMMU debugfs
Date: Mon, 30 Mar 2026 14:33:56 +0530	[thread overview]
Message-ID: <223439cb-3047-4f76-abf9-692e22f4248e@amd.com> (raw)
In-Reply-To: <20260319073754.651998-2-guanghuifeng@linux.alibaba.com>

On 3/19/2026 1:07 PM, Guanghui Feng wrote:
> In the current AMD IOMMU debugFS, when multiple processes use the IOMMU
> debugFS process simultaneously, illegal access issues can occur in the
> following execution flow:
> 
> 1. CPU1: Sets a valid sbdf via devid_write, then checks the sbdf's
> validity in execution flows such as devid_show, iommu_devtbl_show,
> and iommu_irqtbl_show.
> 
> 2. CPU2: Sets an invalid sbdf via devid_write, at which point the sbdf
> value is -1.
> 
> 3. CPU1: accesses the IOMMU device table, IRQ table, based on the
> invalid SBDF value of -1, resulting in illegal access.
> 
> This is especially problematic in monitoring scripts, where multiple
> scripts may access debugFS simultaneously, and some scripts may
> unexpectedly set invalid values, which triggers illegal access in
> debugfs.
> 
> This patch modifies the execution flow of devid_show,
> iommu_devtbl_show, and iommu_irqtbl_show to ensure that these
> processes determine the validity and access based on the
> same device-id, thus guaranteeing correctness and robustness.
> 
 Signed-off-by: Guanghui Feng <guanghuifeng@linux.alibaba.com>

Looks good.

Reviewed-by: Vasant Hegde <vasant.hegde@amd.com>

-Vasant

  reply	other threads:[~2026-03-30  9:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-19  7:37 [PATCH 0/2] Fix illegal " Guanghui Feng
2026-03-19  7:37 ` [PATCH 1/2] iommu/amd: Fix illegal device-id " Guanghui Feng
2026-03-30  9:03   ` Vasant Hegde [this message]
2026-03-19  7:37 ` [PATCH 2/2] iommu/amd: Fix illegal cap/mmio " Guanghui Feng
2026-03-30  9:10   ` Vasant Hegde
2026-03-27  8:29 ` [PATCH 0/2] Fix illegal " Jörg Rödel
2026-03-31 14:58   ` guanghuifeng

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=223439cb-3047-4f76-abf9-692e22f4248e@amd.com \
    --to=vasant.hegde@amd.com \
    --cc=guanghuifeng@linux.alibaba.com \
    --cc=iommu@lists.linux.dev \
    --cc=joro@8bytes.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ming.shu@amd.com \
    --cc=robin.murphy@arm.com \
    --cc=suravee.suthikulpanit@amd.com \
    --cc=will@kernel.org \
    /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

all inboxes | Powered by JetHome®