aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/kernel/vsyscall_64.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/arch/x86/kernel/vsyscall_64.c b/arch/x86/kernel/vsyscall_64.c
index 419e83b58436..2d912629c96e 100644
--- a/arch/x86/kernel/vsyscall_64.c
+++ b/arch/x86/kernel/vsyscall_64.c
@@ -307,6 +307,8 @@ struct vm_area_struct *get_gate_vma(struct mm_struct *mm)
307 if (!mm || mm->context.ia32_compat) 307 if (!mm || mm->context.ia32_compat)
308 return NULL; 308 return NULL;
309#endif 309#endif
310 if (vsyscall_mode == NONE)
311 return NULL;
310 return &gate_vma; 312 return &gate_vma;
311} 313}
312 314
@@ -327,7 +329,7 @@ int in_gate_area(struct mm_struct *mm, unsigned long addr)
327 */ 329 */
328int in_gate_area_no_mm(unsigned long addr) 330int in_gate_area_no_mm(unsigned long addr)
329{ 331{
330 return (addr & PAGE_MASK) == VSYSCALL_ADDR; 332 return vsyscall_mode != NONE && (addr & PAGE_MASK) == VSYSCALL_ADDR;
331} 333}
332 334
333void __init map_vsyscall(void) 335void __init map_vsyscall(void)
@@ -335,10 +337,12 @@ void __init map_vsyscall(void)
335 extern char __vsyscall_page; 337 extern char __vsyscall_page;
336 unsigned long physaddr_vsyscall = __pa_symbol(&__vsyscall_page); 338 unsigned long physaddr_vsyscall = __pa_symbol(&__vsyscall_page);
337 339
338 __set_fixmap(VSYSCALL_PAGE, physaddr_vsyscall, 340 if (vsyscall_mode != NONE)
339 vsyscall_mode == NATIVE 341 __set_fixmap(VSYSCALL_PAGE, physaddr_vsyscall,
340 ? PAGE_KERNEL_VSYSCALL 342 vsyscall_mode == NATIVE
341 : PAGE_KERNEL_VVAR); 343 ? PAGE_KERNEL_VSYSCALL
344 : PAGE_KERNEL_VVAR);
345
342 BUILD_BUG_ON((unsigned long)__fix_to_virt(VSYSCALL_PAGE) != 346 BUILD_BUG_ON((unsigned long)__fix_to_virt(VSYSCALL_PAGE) !=
343 (unsigned long)VSYSCALL_ADDR); 347 (unsigned long)VSYSCALL_ADDR);
344} 348}