Skip to content

Commit bf708cf

Browse files
snitsjoergroedel
authored andcommitted
iommu/vt-d: Call __dmar_remove_one_dev_info with valid pointer
It is possible for archdata.iommu to be set to DEFER_DEVICE_DOMAIN_INFO or DUMMY_DEVICE_DOMAIN_INFO so check for those values before calling __dmar_remove_one_dev_info. Without a check it can result in a null pointer dereference. This has been seen while booting a kdump kernel on an HP dl380 gen9. Cc: Joerg Roedel <[email protected]> Cc: Lu Baolu <[email protected]> Cc: David Woodhouse <[email protected]> Cc: [email protected] # 5.3+ Cc: [email protected] Fixes: ae23bfb ("iommu/vt-d: Detach domain before using a private one") Signed-off-by: Jerry Snitselaar <[email protected]> Acked-by: Lu Baolu <[email protected]> Signed-off-by: Joerg Roedel <[email protected]>
1 parent def9d27 commit bf708cf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/iommu/intel-iommu.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5163,7 +5163,8 @@ static void dmar_remove_one_dev_info(struct device *dev)
51635163

51645164
spin_lock_irqsave(&device_domain_lock, flags);
51655165
info = dev->archdata.iommu;
5166-
if (info)
5166+
if (info && info != DEFER_DEVICE_DOMAIN_INFO
5167+
&& info != DUMMY_DEVICE_DOMAIN_INFO)
51675168
__dmar_remove_one_dev_info(info);
51685169
spin_unlock_irqrestore(&device_domain_lock, flags);
51695170
}

0 commit comments

Comments
 (0)