]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - arch/x86/vdso/vma.c
x86: Set context.vdso before installing the mapping
[karo-tx-linux.git] / arch / x86 / vdso / vma.c
index 7133cdf9098b7ef0366871a92c29ef8aa5445209..93b7a2938b2fb22c24c9d3b7dc03baf6f9ffe5cc 100644 (file)
@@ -115,15 +115,18 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
                goto up_fail;
        }
 
+       current->mm->context.vdso = (void *)addr;
+
        ret = install_special_mapping(mm, addr, vdso_size,
                                      VM_READ|VM_EXEC|
                                      VM_MAYREAD|VM_MAYWRITE|VM_MAYEXEC|
                                      VM_ALWAYSDUMP,
                                      vdso_pages);
-       if (ret)
+       if (ret) {
+               current->mm->context.vdso = NULL;
                goto up_fail;
+       }
 
-       current->mm->context.vdso = (void *)addr;
 up_fail:
        up_write(&mm->mmap_sem);
        return ret;