RE: [PATCH] iommu/vt-d: Remove cache tags before disabling ATS

From: Tian, Kevin
Date: Wed Dec 11 2024 - 02:43:18 EST


> From: Baolu Lu <baolu.lu@xxxxxxxxxxxxxxx>
> Sent: Wednesday, December 11, 2024 3:35 PM
>
> On 2024/12/11 15:21, Tian, Kevin wrote:
> >> From: Lu Baolu<baolu.lu@xxxxxxxxxxxxxxx>
> >> 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.
>

it's the real test case but is a bit misleading when connecting it to
the patch. 😊