Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7a661013 authored by Jan Kiszka's avatar Jan Kiszka Committed by David Woodhouse
Browse files

intel-iommu: Fix use after release during device attach



Obtain the new pgd pointer before releasing the page containing this
value.

Cc: stable@kernel.org
Signed-off-by: default avatarJan Kiszka <jan.kiszka@siemens.com>
Reviewed-by: default avatarSheng Yang <sheng@linux.intel.com>
Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
parent e78bf5e6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3627,9 +3627,9 @@ static int intel_iommu_attach_device(struct iommu_domain *domain,

		pte = dmar_domain->pgd;
		if (dma_pte_present(pte)) {
			free_pgtable_page(dmar_domain->pgd);
			dmar_domain->pgd = (struct dma_pte *)
				phys_to_virt(dma_pte_addr(pte));
			free_pgtable_page(pte);
		}
		dmar_domain->agaw--;
	}