]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
[PATCH] SPARC64: Fix memory corruption in pci_4u_free_consistent().
authorDavid Miller <davem@davemloft.net>
Thu, 26 Oct 2006 06:51:07 +0000 (23:51 -0700)
committerChris Wright <chrisw@sous-sol.org>
Sat, 4 Nov 2006 01:33:46 +0000 (17:33 -0800)
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 <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
arch/sparc64/kernel/pci_iommu.c

index 82e5455134c67719c9cafbdf7dc107a187c56302..2e7f1427088ad439d3a375f5627ec28a2445de8e 100644 (file)
@@ -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);