Commit 8aa11989 authored by Roland McGrath's avatar Roland McGrath Committed by Linus Torvalds

[PATCH] x86_64: fix crash on get_user_pages of ia32 vsyscall page before it's faulted in

God invented symbolic names to help you.  Repeating magic constants by hand
is begging to lose, especially when you get them wrong.  Don't be a loser.

[ Editor's hint: 0xfffe000 vs 0xffffe000 ]
Signed-off-by: default avatarRoland McGrath <roland@redhat.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 5141cdaa
...@@ -462,7 +462,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code) ...@@ -462,7 +462,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code)
#ifdef CONFIG_IA32_EMULATION #ifdef CONFIG_IA32_EMULATION
/* 32bit vsyscall. map on demand. */ /* 32bit vsyscall. map on demand. */
if (test_thread_flag(TIF_IA32) && if (test_thread_flag(TIF_IA32) &&
address >= 0xffffe000 && address < 0xffffe000 + PAGE_SIZE) { address >= VSYSCALL32_BASE && address < VSYSCALL32_END) {
if (map_syscall32(mm, address) < 0) if (map_syscall32(mm, address) < 0)
goto out_of_memory2; goto out_of_memory2;
return; return;
......
...@@ -605,7 +605,7 @@ struct vm_area_struct *get_gate_vma(struct task_struct *tsk) ...@@ -605,7 +605,7 @@ struct vm_area_struct *get_gate_vma(struct task_struct *tsk)
if (test_tsk_thread_flag(tsk, TIF_IA32)) { if (test_tsk_thread_flag(tsk, TIF_IA32)) {
/* lookup code assumes the pages are present. set them up /* lookup code assumes the pages are present. set them up
now */ now */
if (__map_syscall32(tsk->mm, 0xfffe000) < 0) if (__map_syscall32(tsk->mm, VSYSCALL32_BASE) < 0)
return NULL; return NULL;
return &gate32_vma; return &gate32_vma;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment