Skip to content

Commit

Permalink
intel-iommu: Fix oops with intel_iommu=igfx_off
Browse files Browse the repository at this point in the history
The hotplug notifier will call find_domain() to see if the device in
question has been assigned an IOMMU domain. However, this should never
be called for devices with a "dummy" domain, such as graphics devices
when intel_iommu=igfx_off is set and the corresponding IOMMU isn't even
initialised. If you do that, it'll oops as it dereferences the (-1)
pointer.

The notifier function should check iommu_no_mapping() for the
device before doing anything else.

Cc: stable@kernel.org
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
David Woodhouse authored and David Woodhouse committed Dec 8, 2009
1 parent 5595b52 commit 44cd613
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/pci/intel-iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -3247,6 +3247,9 @@ static int device_notifier(struct notifier_block *nb,
struct pci_dev *pdev = to_pci_dev(dev);
struct dmar_domain *domain;

if (iommu_no_mapping(dev))
return 0;

domain = find_domain(pdev);
if (!domain)
return 0;
Expand Down

0 comments on commit 44cd613

Please sign in to comment.