Hi,

Using a static bug finder (EBA - https://github.com/models-team/eba) I
may have found a double spin_lock_irqsave bug in Linux 4.7's
drivers/iommu/intel-iommu.c.

The forward trace is as follows:

1. Starting in function `disable_dmar_iommu' defined at 1706;
   (see 
https://github.com/torvalds/linux/blob/v4.7/drivers/iommu/intel-iommu.c#L1706)
2. the lock `device_domain_lock' is first taken in line 1714:

       spin_lock_irqsave(&device_domain_lock, flags);

3. enter the `list_for_each_entry_safe' loop at 1715;
4. call function `dmar_remove_one_dev_info' (defined at 4850) in line 1726;
   (see 
https://github.com/torvalds/linux/blob/v4.7/drivers/iommu/intel-iommu.c#L4850)
5. finally, the lock is taken a second time in line 4856:

       spin_lock_irqsave(&device_domain_lock, flags);

If that's a bug then I am willing to help with a patch.

Thank you for your time,

Iago
_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu

Reply via email to