public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix fencepost error in x86_64 IOMMU (2.6)
@ 2004-02-17 21:18 Jim Paradis
  0 siblings, 0 replies; only message in thread
From: Jim Paradis @ 2004-02-17 21:18 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 473 bytes --]

There's a fencepost error in the GART IOMMU handling on x86_64
in the unmap path.  When testing to see if the bus address is
within the IOMMU window and needs to be unmapped, the start of
the first page *beyond* the window also passes the test.  This
can cause the first doubleword of the next page beyond the gatt
table to be smashed to zero, with unpredictable results depending
on what that page is used for.

Patch attached for 2.6.  2.4 patch already sent separately.

[-- Attachment #2: pci-gart-fix-2.6.patch --]
[-- Type: text/plain, Size: 523 bytes --]

--- linux-2.6.3-rc4/arch/x86_64/kernel/pci-gart.c.orig	2004-02-17 15:31:25.000000000 -0500
+++ linux-2.6.3-rc4/arch/x86_64/kernel/pci-gart.c	2004-02-17 15:33:13.000000000 -0500
@@ -521,7 +521,7 @@ void pci_unmap_single(struct pci_dev *hw
 	int npages;
 	int i;
 	if (dma_addr < iommu_bus_base + EMERGENCY_PAGES*PAGE_SIZE || 
-	    dma_addr > iommu_bus_base + iommu_size)
+	    dma_addr >= iommu_bus_base + iommu_size)
 		return;
 	iommu_page = (dma_addr - iommu_bus_base)>>PAGE_SHIFT;	
 	npages = to_pages(dma_addr, size);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-02-17 21:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-17 21:18 [PATCH] Fix fencepost error in x86_64 IOMMU (2.6) Jim Paradis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox