Pull button into test branch
[sfrench/cifs-2.6.git] / arch / x86_64 / ia32 / syscall32.c
index 816a3b89f13d870865d0a85353ae7a58c7386b65..3e5ed20cba457c7f5e0ff149cab3ec124d20ef52 100644 (file)
 #include <asm/tlbflush.h>
 #include <asm/ia32_unistd.h>
 
-/* 32bit VDSOs mapped into user space. */ 
-asm(".section \".init.data\",\"aw\"\n"
-    "syscall32_syscall:\n"
-    ".incbin \"arch/x86_64/ia32/vsyscall-syscall.so\"\n"
-    "syscall32_syscall_end:\n"
-    "syscall32_sysenter:\n"
-    ".incbin \"arch/x86_64/ia32/vsyscall-sysenter.so\"\n"
-    "syscall32_sysenter_end:\n"
-    ".previous");
-
 extern unsigned char syscall32_syscall[], syscall32_syscall_end[];
 extern unsigned char syscall32_sysenter[], syscall32_sysenter_end[];
 extern int sysctl_vsyscall32;
@@ -59,20 +49,16 @@ int syscall32_setup_pages(struct linux_binprm *bprm, int exstack)
        struct mm_struct *mm = current->mm;
        int ret;
 
-       vma = kmem_cache_alloc(vm_area_cachep, SLAB_KERNEL);
+       vma = kmem_cache_alloc(vm_area_cachep, GFP_KERNEL);
        if (!vma)
                return -ENOMEM;
-       if (security_vm_enough_memory(npages)) {
-               kmem_cache_free(vm_area_cachep, vma);
-               return -ENOMEM;
-       }
 
        memset(vma, 0, sizeof(struct vm_area_struct));
        /* Could randomize here */
        vma->vm_start = VSYSCALL32_BASE;
        vma->vm_end = VSYSCALL32_END;
        /* MAYWRITE to allow gdb to COW and set breakpoints */
-       vma->vm_flags = VM_READ|VM_EXEC|VM_MAYREAD|VM_MAYEXEC|VM_MAYEXEC|VM_MAYWRITE;
+       vma->vm_flags = VM_READ|VM_EXEC|VM_MAYREAD|VM_MAYEXEC|VM_MAYWRITE;
        vma->vm_flags |= mm->def_flags;
        vma->vm_page_prot = protection_map[vma->vm_flags & 7];
        vma->vm_ops = &syscall32_vm_ops;