Skip to content

Commit ff8b885

Browse files
author
CKI Backport Bot
committed
iommu/vt-d: Fix incorrect pci_for_each_dma_alias() for non-PCI devices
JIRA: https://issues.redhat.com/browse/RHEL-65892 CVE: CVE-2024-50101 commit 6e02a27 Author: Lu Baolu <baolu.lu@linux.intel.com> Date: Mon Oct 14 09:37:44 2024 +0800 iommu/vt-d: Fix incorrect pci_for_each_dma_alias() for non-PCI devices Previously, the domain_context_clear() function incorrectly called pci_for_each_dma_alias() to set up context entries for non-PCI devices. This could lead to kernel hangs or other unexpected behavior. Add a check to only call pci_for_each_dma_alias() for PCI devices. For non-PCI devices, domain_context_clear_one() is called directly. Reported-by: Todd Brandt <todd.e.brandt@intel.com> Closes: https://bugzilla.kernel.org/show_bug.cgi?id=219363 Closes: https://bugzilla.kernel.org/show_bug.cgi?id=219349 Fixes: 9a16ab9 ("iommu/vt-d: Make context clearing consistent with context mapping") Cc: stable@vger.kernel.org Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com> Link: https://lore.kernel.org/r/20241014013744.102197-2-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel <jroedel@suse.de> Signed-off-by: CKI Backport Bot <cki-ci-bot+cki-gitlab-backport-bot@redhat.com>
1 parent 2abc119 commit ff8b885

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/iommu/intel/iommu.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3520,8 +3520,10 @@ static int domain_context_clear_one_cb(struct pci_dev *pdev, u16 alias, void *op
35203520
*/
35213521
static void domain_context_clear(struct device_domain_info *info)
35223522
{
3523-
if (!dev_is_pci(info->dev))
3523+
if (!dev_is_pci(info->dev)) {
35243524
domain_context_clear_one(info, info->bus, info->devfn);
3525+
return;
3526+
}
35253527

35263528
pci_for_each_dma_alias(to_pci_dev(info->dev),
35273529
&domain_context_clear_one_cb, info);

0 commit comments

Comments
 (0)