Re: ext3 oops on shutdown

From: David Miller
Date: Thu Oct 26 2006 - 02:07:20 EST


From: David Miller <davem@xxxxxxxxxxxxx>
Date: Wed, 25 Oct 2006 00:51:34 -0700 (PDT)

> It's probably some sparc64 issue, maybe even some error wrt. freeing
> up init memory. I'll try to track it down. I'm actually quite
> curious what this bug is :-)

Yep, a sparc64 bug, I'll push this to Linus shortly...

commit 2506be0657c7bd1befdb616fb0e86d87c6a288cd
Author: David S. Miller <davem@xxxxxxxxxxxxxxxxxxxx>
Date: Wed Oct 25 22:33:07 2006 -0700

[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 <davem@xxxxxxxxxxxxx>

diff --git a/arch/sparc64/kernel/pci_iommu.c b/arch/sparc64/kernel/pci_iommu.c
index 82e5455..2e7f142 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(struc

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);

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/