From: David S. Miller Date: Thu, 26 Oct 2006 05:33:07 +0000 (-0700) Subject: [SPARC64]: Fix memory corruption in pci_4u_free_consistent(). X-Git-Tag: v2.6.19-rc4~75^2 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=012d64ff68f304df1c35ce5902f5023dc14b643f;p=linux-2.6-omap-h63xx.git [SPARC64]: Fix memory corruption in pci_4u_free_consistent(). The second argument to free_npages() was being incorrectly calculated, which would thus access far past the end of the arena->map[] bitmap. Signed-off-by: David S. Miller --- diff --git a/arch/sparc64/kernel/pci_iommu.c b/arch/sparc64/kernel/pci_iommu.c index 82e5455134c..2e7f1427088 100644 --- a/arch/sparc64/kernel/pci_iommu.c +++ b/arch/sparc64/kernel/pci_iommu.c @@ -281,7 +281,7 @@ static void pci_4u_free_consistent(struct pci_dev *pdev, size_t size, void *cpu, spin_lock_irqsave(&iommu->lock, flags); - free_npages(iommu, dvma, npages); + free_npages(iommu, dvma - iommu->page_table_map_base, npages); spin_unlock_irqrestore(&iommu->lock, flags);