Skip to content

Commit

Permalink
intel-iommu: Fix use after release during device attach
Browse files Browse the repository at this point in the history
Obtain the new pgd pointer before releasing the page containing this
value.

Cc: stable@kernel.org
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Reviewed-by: Sheng Yang <sheng@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
Jan Kiszka authored and David Woodhouse committed Jan 17, 2011
1 parent e78bf5e commit 7a66101
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/pci/intel-iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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--;
}
Expand Down

0 comments on commit 7a66101

Please sign in to comment.