Re: [PATCH v3] PCI: Ensure ATS disabled via quirk before notifying IOMMU drivers

From: David Matlack

Date: Fri Jun 12 2026 - 17:57:43 EST


On Fri, Apr 3, 2026 at 3:27 PM David Matlack <dmatlack@xxxxxxxxxx> wrote:
>
> Ensure that PCI devices always have ATS disable via quirk before IOMMU
> drivers are notified about the device. Fix this by converting the
> existing quirks from final to header fixups and changing the quirk logic
> to set a new no_ats bit in struct pci_dev that prevents pci_dev.ats_cap
> from ever getting set.
>
> Use header fixups instead of early fixups since not enough of struct
> pci_dev is set up in during early fixups: quirk_amd_harvest_no_ats()
> needs subsystem_device and subsystem_vendor to be set.
>
> This change ensures that pci_ats_supported() always takes quirks into
> account during iommu_ops.probe_device(), when IOMMU drivers are notified
> about devices, and that pci_ats_supported() returns the same value when
> the device is released in iommu_ops.release_device().
>
> Notably, the Intel IOMMU driver uses pci_ats_supported() in
> probe/release to determine whether to add/remove a device from a data
> structure, which easily leads to a use-after-free without this fix.
>
> This change also makes disabling ATS via quirk behave the same way as
> the pci=noats command line option, in that pci_ats_init() bails
> immediately and never initializes pci_dev.ats_cap.
>
> Note: In practice this fix only matters for PCI devices created after
> IOMMU bus notifiers are set up (e.g. hot-plugged devices and VFs).
>
> Fixes: a18615b1cfc0 ("PCI: Disable ATS for specific Intel IPU E2000 devices")
> Closes: https://lore.kernel.org/linux-iommu/aYUQ_HkDJU9kjsUl@xxxxxxxxxx/
> Signed-off-by: David Matlack <dmatlack@xxxxxxxxxx>

Hi Bjorn,

Sorry for the ping but I wanted to double check if this one is still
on your radar and if it can be picked up for a future release.

Thanks.