Commit f7b6eb3f authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Ingo Molnar

x86: Set context.vdso before installing the mapping

In order to make arch_vma_name() work from inside
install_special_mapping() we need to set the context.vdso
before calling it.

( This is needed for performance counters to be able to track
  this special executable area. )
Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
LKML-Reference: <new-submission>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent cf1f4574
...@@ -338,6 +338,8 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) ...@@ -338,6 +338,8 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
} }
} }
current->mm->context.vdso = (void *)addr;
if (compat_uses_vma || !compat) { if (compat_uses_vma || !compat) {
/* /*
* MAYWRITE to allow gdb to COW and set breakpoints * MAYWRITE to allow gdb to COW and set breakpoints
...@@ -358,11 +360,13 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) ...@@ -358,11 +360,13 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
goto up_fail; goto up_fail;
} }
current->mm->context.vdso = (void *)addr;
current_thread_info()->sysenter_return = current_thread_info()->sysenter_return =
VDSO32_SYMBOL(addr, SYSENTER_RETURN); VDSO32_SYMBOL(addr, SYSENTER_RETURN);
up_fail: up_fail:
if (ret)
current->mm->context.vdso = NULL;
up_write(&mm->mmap_sem); up_write(&mm->mmap_sem);
return ret; return ret;
......
...@@ -115,15 +115,18 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) ...@@ -115,15 +115,18 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
goto up_fail; goto up_fail;
} }
current->mm->context.vdso = (void *)addr;
ret = install_special_mapping(mm, addr, vdso_size, ret = install_special_mapping(mm, addr, vdso_size,
VM_READ|VM_EXEC| VM_READ|VM_EXEC|
VM_MAYREAD|VM_MAYWRITE|VM_MAYEXEC| VM_MAYREAD|VM_MAYWRITE|VM_MAYEXEC|
VM_ALWAYSDUMP, VM_ALWAYSDUMP,
vdso_pages); vdso_pages);
if (ret) if (ret) {
current->mm->context.vdso = NULL;
goto up_fail; goto up_fail;
}
current->mm->context.vdso = (void *)addr;
up_fail: up_fail:
up_write(&mm->mmap_sem); up_write(&mm->mmap_sem);
return ret; return ret;
......
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