[patch] don't double >> PAGE_SHIFT pointer for /dev/kmem access

From: Jes Sorensen <jes_at_sgi.com>
Date: 2006-10-25 19:49:53
Hi,

This one has been around for a while, but it's a pretty serious bug,
so if you would push it upstream quickly that would be great. Thanks
to Bjorn for spotting it.

Cheers,
Jes


Don't PAGE_SHIFT pointer before handing it to virt_to_page() in
xlate_dev_kmem_ptr() as it results in a double shift.

Spotted by Bjorn 'Eagleeye' Helgaas.

Signed-off-by: Jes Sorensen <jes@sgi.com>

---
 include/asm-ia64/uaccess.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6/include/asm-ia64/uaccess.h
===================================================================
--- linux-2.6.orig/include/asm-ia64/uaccess.h
+++ linux-2.6/include/asm-ia64/uaccess.h
@@ -389,7 +389,7 @@ xlate_dev_kmem_ptr (char * p)
 	struct page *page;
 	char * ptr;
 
-	page = virt_to_page((unsigned long)p >> PAGE_SHIFT);
+	page = virt_to_page((unsigned long)p);
 	if (PageUncached(page))
 		ptr = (char *)__pa(p) + __IA64_UNCACHED_OFFSET;
 	else
-
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Wed Oct 25 19:50:00 2006

This archive was generated by hypermail 2.1.8 : 2006-10-25 19:50:28 EST