aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/include/asm/mman.h3
-rw-r--r--arch/arm/kernel/calls.S2
-rw-r--r--arch/arm/kernel/sys_arm.c25
3 files changed, 4 insertions, 26 deletions
diff --git a/arch/arm/include/asm/mman.h b/arch/arm/include/asm/mman.h
index 8eebf89f5ab1..41f99c573b93 100644
--- a/arch/arm/include/asm/mman.h
+++ b/arch/arm/include/asm/mman.h
@@ -1 +1,4 @@
1#include <asm-generic/mman.h> 1#include <asm-generic/mman.h>
2
3#define arch_mmap_check(addr, len, flags) \
4 (((flags) & MAP_FIXED && (addr) < FIRST_USER_ADDRESS) ? -EINVAL : 0)
diff --git a/arch/arm/kernel/calls.S b/arch/arm/kernel/calls.S
index f58c1156e779..9314a2d681f1 100644
--- a/arch/arm/kernel/calls.S
+++ b/arch/arm/kernel/calls.S
@@ -172,7 +172,7 @@
172/* 160 */ CALL(sys_sched_get_priority_min) 172/* 160 */ CALL(sys_sched_get_priority_min)
173 CALL(sys_sched_rr_get_interval) 173 CALL(sys_sched_rr_get_interval)
174 CALL(sys_nanosleep) 174 CALL(sys_nanosleep)
175 CALL(sys_arm_mremap) 175 CALL(sys_mremap)
176 CALL(sys_setresuid16) 176 CALL(sys_setresuid16)
177/* 165 */ CALL(sys_getresuid16) 177/* 165 */ CALL(sys_getresuid16)
178 CALL(sys_ni_syscall) /* vm86 */ 178 CALL(sys_ni_syscall) /* vm86 */
diff --git a/arch/arm/kernel/sys_arm.c b/arch/arm/kernel/sys_arm.c
index 78ecaac65206..3b897444a9bd 100644
--- a/arch/arm/kernel/sys_arm.c
+++ b/arch/arm/kernel/sys_arm.c
@@ -28,10 +28,6 @@
28#include <linux/ipc.h> 28#include <linux/ipc.h>
29#include <linux/uaccess.h> 29#include <linux/uaccess.h>
30 30
31extern unsigned long do_mremap(unsigned long addr, unsigned long old_len,
32 unsigned long new_len, unsigned long flags,
33 unsigned long new_addr);
34
35/* common code for old and new mmaps */ 31/* common code for old and new mmaps */
36inline long do_mmap2( 32inline long do_mmap2(
37 unsigned long addr, unsigned long len, 33 unsigned long addr, unsigned long len,
@@ -43,9 +39,6 @@ inline long do_mmap2(
43 39
44 flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE); 40 flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE);
45 41
46 if (flags & MAP_FIXED && addr < FIRST_USER_ADDRESS)
47 goto out;
48
49 error = -EBADF; 42 error = -EBADF;
50 if (!(flags & MAP_ANONYMOUS)) { 43 if (!(flags & MAP_ANONYMOUS)) {
51 file = fget(fd); 44 file = fget(fd);
@@ -89,24 +82,6 @@ out:
89 return error; 82 return error;
90} 83}
91 84
92asmlinkage unsigned long
93sys_arm_mremap(unsigned long addr, unsigned long old_len,
94 unsigned long new_len, unsigned long flags,
95 unsigned long new_addr)
96{
97 unsigned long ret = -EINVAL;
98
99 if (flags & MREMAP_FIXED && new_addr < FIRST_USER_ADDRESS)
100 goto out;
101
102 down_write(&current->mm->mmap_sem);
103 ret = do_mremap(addr, old_len, new_len, flags, new_addr);
104 up_write(&current->mm->mmap_sem);
105
106out:
107 return ret;
108}
109
110/* 85/*
111 * Perform the select(nd, in, out, ex, tv) and mmap() system 86 * Perform the select(nd, in, out, ex, tv) and mmap() system
112 * calls. 87 * calls.