MIPS: Use per-mm page to execute branch delay slot instructions
[cascardo/linux.git] / arch / mips / kernel / vdso.c
index 54e1663..9abe447 100644 (file)
@@ -107,6 +107,16 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
        if (down_write_killable(&mm->mmap_sem))
                return -EINTR;
 
+       /* Map delay slot emulation page */
+       base = mmap_region(NULL, STACK_TOP, PAGE_SIZE,
+                          VM_READ|VM_WRITE|VM_EXEC|
+                          VM_MAYREAD|VM_MAYWRITE|VM_MAYEXEC,
+                          0);
+       if (IS_ERR_VALUE(base)) {
+               ret = base;
+               goto out;
+       }
+
        /*
         * Determine total area size. This includes the VDSO data itself, the
         * data page, and the GIC user page if present. Always create a mapping