public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Baolu Lu <baolu.lu@linux.intel.com>
To: "Tian, Kevin" <kevin.tian@intel.com>,
	Joerg Roedel <joro@8bytes.org>, Will Deacon <will@kernel.org>,
	Robin Murphy <robin.murphy@arm.com>,
	"Liu, Yi L" <yi.l.liu@intel.com>
Cc: baolu.lu@linux.intel.com,
	"iommu@lists.linux.dev" <iommu@lists.linux.dev>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>
Subject: Re: [PATCH] iommu/vt-d: Remove cache tags before disabling ATS
Date: Wed, 11 Dec 2024 15:35:20 +0800	[thread overview]
Message-ID: <0899838f-7845-48e3-a5b6-7a2d00ce0bac@linux.intel.com> (raw)
In-Reply-To: <BN9PR11MB52766D13B14053E5B6CFE7D48C3E2@BN9PR11MB5276.namprd11.prod.outlook.com>

On 2024/12/11 15:21, Tian, Kevin wrote:
>> From: Lu Baolu<baolu.lu@linux.intel.com>
>> Sent: Friday, November 29, 2024 10:05 AM
>>
>> The current implementation removes cache tags after disabling ATS,
>> leading to potential memory leaks and kernel crashes. Specifically,
>> CACHE_TAG_DEVTLB type cache tags may still remain in the list even
>> after the domain is freed, causing a use-after-free condition.
>>
>> This issue really shows up when multiple VFs from different PFs
>> passed through to a single user-space process via vfio-pci. In such
>> cases, the kernel may crash with kernel messages like:
> Is "multiple VFs from different PFs" the key to trigger the problem?

This is the real test case that triggered this issue. It's definitely
not the only case that could trigger this issue.

> 
> what about multiple VFs from the same PF or just assigning multiple
> devices to a single process/vm?

I think it's possible.

> My understanding from the below fix is that this issue will be triggered
> as long as the domain is still being actively used after one device with
> ATS is detached from it, i.e. sounds like a problem in multi-device
> assignment scenario.

Yes.

Thanks,
baolu

  reply	other threads:[~2024-12-11  7:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-29  2:05 [PATCH] iommu/vt-d: Remove cache tags before disabling ATS Lu Baolu
2024-12-11  7:21 ` Tian, Kevin
2024-12-11  7:35   ` Baolu Lu [this message]
2024-12-11  7:42     ` Tian, Kevin

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=0899838f-7845-48e3-a5b6-7a2d00ce0bac@linux.intel.com \
    --to=baolu.lu@linux.intel.com \
    --cc=iommu@lists.linux.dev \
    --cc=joro@8bytes.org \
    --cc=kevin.tian@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=stable@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox