Thread (15 messages) 15 messages, 4 authors, 2025-11-20

Re: [PATCH v2 2/3] iommu/amd: Don't call report_iommu_fault()

From: Jason Gunthorpe <jgg@nvidia.com>
Date: 2025-11-20 19:35:11
Also in: linux-arm-msm, linux-iommu, linux-mediatek, linux-patches, linux-rdma, linux-rockchip, linux-sunxi

On Tue, Nov 18, 2025 at 11:58:39PM +0000, Tian, Kevin wrote:
quoted
quoted
quoted
-
-			if (!report_iommu_fault(&dev_data->domain-
quoted
domain,
-						&pdev->dev, address,
-						IS_WRITE_REQUEST(flags) ?
-
	IOMMU_FAULT_WRITE :
-
	IOMMU_FAULT_READ))
-				goto out;
 		}

 		if (__ratelimit(&dev_data->rs)) {
Remove amd_iommu_report_page_fault() too?
I don't understand this remark?

amd_iommu_report_page_fault() generates the dmesg logging on iommu
faults?
sorry I meant generating the dmesg logging same as other error
types in iommu_print_event(). No need for a separate function.
Okay, that does make sense, but this driver is kinda broken because it
is using 

	pdev = pci_get_domain_bus_and_slot(iommu->pci_seg->id, PCI_BUS_NUM(devid),
					   devid & 0xff);
	if (pdev)
		dev_data = dev_iommu_priv_get(&pdev->dev);

Which is UAF racy on dev_data.

Fixing that is troublesome..

Really all the fault handling here needs some attention, all the
events that have BDFs should all print the same, using a pci print or
using raw BDFs. Translation fault shouldn't be special..

Too big for this series, so I'll leave it..

Thanks,
Jason


Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help