
From: John Blackwood <john.blackwood@ccur.com>

We noticed a problem on x86_64 platforms where a /proc read of the
vsyscall area (address 0xffffffffff600000) would cause the kernel to
oops in get_user_pages().

I believe that the fix is to pull in the include/asm-ia64/pgtable.h
changes for pgd_offset_gate() into the x86_64 pgtable.h header file.

Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/include/asm-x86_64/pgtable.h |    7 +++++++
 1 files changed, 7 insertions(+)

diff -puN include/asm-x86_64/pgtable.h~include-asm-x86_64-pgtableh-pgd_offset_gate include/asm-x86_64/pgtable.h
--- 25/include/asm-x86_64/pgtable.h~include-asm-x86_64-pgtableh-pgd_offset_gate	2004-12-12 01:04:46.000000000 -0800
+++ 25-akpm/include/asm-x86_64/pgtable.h	2004-12-12 01:32:23.036203584 -0800
@@ -309,6 +309,12 @@ static inline int pmd_large(pmd_t pte) {
 #define mk_kernel_pml4(address) ((pml4_t){ (address) | _KERNPG_TABLE })
 #define level3_offset_k(dir, address) ((pgd_t *) pml4_page(*(dir)) + pgd_index(address))
 
+/*
+ * Look up a pgd entry in the gate area.  On x86_64, the gate-area resides in
+ * the kernel-mapped segment, hence we use pgd_offset_k() here.
+ */
+#define pgd_offset_gate(mm, addr)	pgd_offset_k(addr)
+
 /* PGD - Level3 access */
 /* to find an entry in a page-table-directory. */
 #define pgd_index(address) ((address >> PGDIR_SHIFT) & (PTRS_PER_PGD-1))
@@ -443,6 +449,7 @@ extern int kern_addr_valid(unsigned long
 #define __HAVE_ARCH_PTEP_SET_WRPROTECT
 #define __HAVE_ARCH_PTEP_MKDIRTY
 #define __HAVE_ARCH_PTE_SAME
+#define __HAVE_ARCH_PGD_OFFSET_GATE
 #include <asm-generic/pgtable.h>
 
 #endif /* _X86_64_PGTABLE_H */
_
