2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
Date: Tue, 2 Nov 2010 08:05:51 +0100
Subject: [PATCH] intel-iommu: Fix use after release during device attach

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

Cc: [email protected]
Signed-off-by: Jan Kiszka <[email protected]>
Signed-off-by: Andi Kleen <[email protected]>
Reviewed-by: Sheng Yang <[email protected]>
Signed-off-by: David Woodhouse <[email protected]>
---
 drivers/pci/intel-iommu.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Index: linux-2.6.35.y/drivers/pci/intel-iommu.c
===================================================================
--- linux-2.6.35.y.orig/drivers/pci/intel-iommu.c
+++ linux-2.6.35.y/drivers/pci/intel-iommu.c
@@ -3638,9 +3638,9 @@ static int intel_iommu_attach_device(str
 
                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--;
        }

_______________________________________________
stable mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/stable

Reply via email to