Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetr Vandrovec <vandrove@vc.cvut.cz>2005-01-20 19:57:23 -0800
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-01-20 19:57:23 -0800
commit7cfa3f596b40f8627d783ec45dc0534a410eafb4 (patch)
treebebdc1146e0095cdbf82d4d80c2094a983e47ced
parent88835ba226fef3096c3b53f6d62acf1a7c589f35 (diff)
[PATCH] Fix x86-64 vsyscall32 mapping
The x86-64 kernel incorrectly marks the 32-bit vsyscall page mapping at virtual address 0xffffe000 as a global one, even though that mapping does not exist globally. As such, task switches do not correctly invalidate the mapping, and strange behaviour ensues if a 64-bit program happens to use that same virtual address for something else. Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--arch/x86_64/ia32/syscall32.c2
-rw-r--r--include/asm-x86_64/pgtable.h1
2 files changed, 2 insertions, 1 deletions
diff --git a/arch/x86_64/ia32/syscall32.c b/arch/x86_64/ia32/syscall32.c
index b774b07c8569..399ff4985099 100644
--- a/arch/x86_64/ia32/syscall32.c
+++ b/arch/x86_64/ia32/syscall32.c
@@ -55,7 +55,7 @@ int __map_syscall32(struct mm_struct *mm, unsigned long address)
if (pte_none(*pte)) {
set_pte(pte,
mk_pte(virt_to_page(syscall32_page),
- PAGE_KERNEL_VSYSCALL));
+ PAGE_KERNEL_VSYSCALL32));
}
/* Flush only the local CPU. Other CPUs taking a fault
will just end up here again
diff --git a/include/asm-x86_64/pgtable.h b/include/asm-x86_64/pgtable.h
index 4c9ba28b77bc..bad74ab85971 100644
--- a/include/asm-x86_64/pgtable.h
+++ b/include/asm-x86_64/pgtable.h
@@ -182,6 +182,7 @@ extern inline void pgd_clear (pgd_t * pgd)
#define PAGE_KERNEL_EXEC MAKE_GLOBAL(__PAGE_KERNEL_EXEC)
#define PAGE_KERNEL_RO MAKE_GLOBAL(__PAGE_KERNEL_RO)
#define PAGE_KERNEL_NOCACHE MAKE_GLOBAL(__PAGE_KERNEL_NOCACHE)
+#define PAGE_KERNEL_VSYSCALL32 __pgprot(__PAGE_KERNEL_VSYSCALL)
#define PAGE_KERNEL_VSYSCALL MAKE_GLOBAL(__PAGE_KERNEL_VSYSCALL)
#define PAGE_KERNEL_LARGE MAKE_GLOBAL(__PAGE_KERNEL_LARGE)
#define PAGE_KERNEL_VSYSCALL_NOCACHE MAKE_GLOBAL(__PAGE_KERNEL_VSYSCALL_NOCACHE)