diff options
Diffstat (limited to 'arch/x86_64/ia32/syscall32.c')
-rw-r--r-- | arch/x86_64/ia32/syscall32.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/arch/x86_64/ia32/syscall32.c b/arch/x86_64/ia32/syscall32.c index adbc5f8089e9..3a01329473ab 100644 --- a/arch/x86_64/ia32/syscall32.c +++ b/arch/x86_64/ia32/syscall32.c | |||
@@ -52,17 +52,13 @@ int syscall32_setup_pages(struct linux_binprm *bprm, int exstack) | |||
52 | vma = kmem_cache_alloc(vm_area_cachep, SLAB_KERNEL); | 52 | vma = kmem_cache_alloc(vm_area_cachep, SLAB_KERNEL); |
53 | if (!vma) | 53 | if (!vma) |
54 | return -ENOMEM; | 54 | return -ENOMEM; |
55 | if (security_vm_enough_memory(npages)) { | ||
56 | kmem_cache_free(vm_area_cachep, vma); | ||
57 | return -ENOMEM; | ||
58 | } | ||
59 | 55 | ||
60 | memset(vma, 0, sizeof(struct vm_area_struct)); | 56 | memset(vma, 0, sizeof(struct vm_area_struct)); |
61 | /* Could randomize here */ | 57 | /* Could randomize here */ |
62 | vma->vm_start = VSYSCALL32_BASE; | 58 | vma->vm_start = VSYSCALL32_BASE; |
63 | vma->vm_end = VSYSCALL32_END; | 59 | vma->vm_end = VSYSCALL32_END; |
64 | /* MAYWRITE to allow gdb to COW and set breakpoints */ | 60 | /* MAYWRITE to allow gdb to COW and set breakpoints */ |
65 | vma->vm_flags = VM_READ|VM_EXEC|VM_MAYREAD|VM_MAYEXEC|VM_MAYEXEC|VM_MAYWRITE; | 61 | vma->vm_flags = VM_READ|VM_EXEC|VM_MAYREAD|VM_MAYEXEC|VM_MAYWRITE; |
66 | vma->vm_flags |= mm->def_flags; | 62 | vma->vm_flags |= mm->def_flags; |
67 | vma->vm_page_prot = protection_map[vma->vm_flags & 7]; | 63 | vma->vm_page_prot = protection_map[vma->vm_flags & 7]; |
68 | vma->vm_ops = &syscall32_vm_ops; | 64 | vma->vm_ops = &syscall32_vm_ops; |