mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-22 02:20:40 +00:00
iommu/vt-d: Call __dmar_remove_one_dev_info with valid pointer
commitbf708cfb2f
upstream. 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 <joro@8bytes.org> Cc: Lu Baolu <baolu.lu@linux.intel.com> Cc: David Woodhouse <dwmw2@infradead.org> Cc: stable@vger.kernel.org # 5.3+ Cc: linux-kernel@vger.kernel.org Fixes:ae23bfb68f
("iommu/vt-d: Detach domain before using a private one") Signed-off-by: Jerry Snitselaar <jsnitsel@redhat.com> Acked-by: Lu Baolu <baolu.lu@linux.intel.com> Signed-off-by: Joerg Roedel <jroedel@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
d4616a9f8e
commit
5d1973adcf
1 changed files with 2 additions and 1 deletions
|
@ -5132,7 +5132,8 @@ static void dmar_remove_one_dev_info(struct device *dev)
|
|||
|
||||
spin_lock_irqsave(&device_domain_lock, flags);
|
||||
info = dev->archdata.iommu;
|
||||
if (info)
|
||||
if (info && info != DEFER_DEVICE_DOMAIN_INFO
|
||||
&& info != DUMMY_DEVICE_DOMAIN_INFO)
|
||||
__dmar_remove_one_dev_info(info);
|
||||
spin_unlock_irqrestore(&device_domain_lock, flags);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue