diff options
Diffstat (limited to 'arch/powerpc/kernel/vdso.c')
-rw-r--r-- | arch/powerpc/kernel/vdso.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/arch/powerpc/kernel/vdso.c b/arch/powerpc/kernel/vdso.c index 3faaf29bdb29..94e2df3cae07 100644 --- a/arch/powerpc/kernel/vdso.c +++ b/arch/powerpc/kernel/vdso.c | |||
@@ -241,6 +241,13 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) | |||
241 | } | 241 | } |
242 | 242 | ||
243 | /* | 243 | /* |
244 | * Put vDSO base into mm struct. We need to do this before calling | ||
245 | * install_special_mapping or the perf counter mmap tracking code | ||
246 | * will fail to recognise it as a vDSO (since arch_vma_name fails). | ||
247 | */ | ||
248 | current->mm->context.vdso_base = vdso_base; | ||
249 | |||
250 | /* | ||
244 | * our vma flags don't have VM_WRITE so by default, the process isn't | 251 | * our vma flags don't have VM_WRITE so by default, the process isn't |
245 | * allowed to write those pages. | 252 | * allowed to write those pages. |
246 | * gdb can break that with ptrace interface, and thus trigger COW on | 253 | * gdb can break that with ptrace interface, and thus trigger COW on |
@@ -260,11 +267,10 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) | |||
260 | VM_MAYREAD|VM_MAYWRITE|VM_MAYEXEC| | 267 | VM_MAYREAD|VM_MAYWRITE|VM_MAYEXEC| |
261 | VM_ALWAYSDUMP, | 268 | VM_ALWAYSDUMP, |
262 | vdso_pagelist); | 269 | vdso_pagelist); |
263 | if (rc) | 270 | if (rc) { |
271 | current->mm->context.vdso_base = 0; | ||
264 | goto fail_mmapsem; | 272 | goto fail_mmapsem; |
265 | 273 | } | |
266 | /* Put vDSO base into mm struct */ | ||
267 | current->mm->context.vdso_base = vdso_base; | ||
268 | 274 | ||
269 | up_write(&mm->mmap_sem); | 275 | up_write(&mm->mmap_sem); |
270 | return 0; | 276 | return 0; |