Re: [PATCH] PCI: Disable ATS via quirk before notifying IOMMU drivers
From: Andy Shevchenko
Date: Mon Feb 23 2026 - 15:39:51 EST
On Mon, Feb 23, 2026 at 06:40:16PM +0000, David Matlack wrote:
> Ensure that PCI devices that have ATS disabled via quirk have it
> disabled before IOMMU drivers are notified about the device. Otherwise
> the IOMMU driver will see that the device has ATS enabled during probing
> and then later it will get disabled.
>
> This fixes at least one bug in the Intel IOMMU driver where it adds the
> device to an rbtree because it sees ATS is enabled, but then ATS gets
> disabled via quirk. When the device is destroyed (e.g. hot-unplug, VF
> destruction, etc.) the driver sees that ATS is disabled and does not
> remove it from the rbtree. This inevitably leads to a use-after-free
> and corruption of the rbtree.
>
> Fix this by disabling ATS via quirk during "early" fixups instead of
> "final" fixups.
Hmm... Sounds to me like a premature disablement, but I leave it the experts.
What I think about the case, that IOMMU should be probably fixed to avoid such
situation for all level of quirks. Can it be feasible?
> Fixes: a18615b1cfc0 ("PCI: Disable ATS for specific Intel IPU E2000 devices")
> Closes: https://lore.kernel.org/linux-iommu/aYUQ_HkDJU9kjsUl@xxxxxxxxxx/
> Cc: Raghavendra Rao Ananta <rananta@xxxxxxxxxx>
> Cc: David Woodhouse <dwmw2@xxxxxxxxxxxxx>
> Cc: Lu Baolu <baolu.lu@xxxxxxxxxxxxxxx>
These...
> Signed-off-by: David Matlack <dmatlack@xxxxxxxxxx>
> ---
...may go here with the same effect on email, but reducing the unneeded noise
in the actual Git history.
--
With Best Regards,
Andy Shevchenko