]> git.hungrycats.org Git - linux/commitdiff
[PATCH] Fix x86-64 vsyscall32 mapping
authorPetr Vandrovec <vandrove@vc.cvut.cz>
Fri, 21 Jan 2005 03:57:23 +0000 (19:57 -0800)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Fri, 21 Jan 2005 03:57:23 +0000 (19:57 -0800)
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>
arch/x86_64/ia32/syscall32.c
include/asm-x86_64/pgtable.h

index b774b07c8569b875eb3d7409d2600f46fd2e6a51..399ff498509978c834420c82bc539ed4bfe6b268 100644 (file)
@@ -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
index 4c9ba28b77bcf67529533290490a4ca514825cd5..bad74ab859717a58476a65c7eeceb93985c1160c 100644 (file)
@@ -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)