aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/kernel/syscall.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/kernel/syscall.c')
-rw-r--r--arch/mips/kernel/syscall.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/arch/mips/kernel/syscall.c b/arch/mips/kernel/syscall.c
index 1da2eeb3ef9e..2aeaa2fd4b32 100644
--- a/arch/mips/kernel/syscall.c
+++ b/arch/mips/kernel/syscall.c
@@ -162,7 +162,10 @@ asmlinkage unsigned long
162sys_mmap2(unsigned long addr, unsigned long len, unsigned long prot, 162sys_mmap2(unsigned long addr, unsigned long len, unsigned long prot,
163 unsigned long flags, unsigned long fd, unsigned long pgoff) 163 unsigned long flags, unsigned long fd, unsigned long pgoff)
164{ 164{
165 return do_mmap2(addr, len, prot, flags, fd, pgoff); 165 if (pgoff & (~PAGE_MASK >> 12))
166 return -EINVAL;
167
168 return do_mmap2(addr, len, prot, flags, fd, pgoff >> (PAGE_SHIFT-12));
166} 169}
167 170
168save_static_function(sys_fork); 171save_static_function(sys_fork);
@@ -345,7 +348,7 @@ asmlinkage int sys_ipc (uint call, int first, int second,
345 union semun fourth; 348 union semun fourth;
346 if (!ptr) 349 if (!ptr)
347 return -EINVAL; 350 return -EINVAL;
348 if (get_user(fourth.__pad, (void *__user *) ptr)) 351 if (get_user(fourth.__pad, (void __user *__user *) ptr))
349 return -EFAULT; 352 return -EFAULT;
350 return sys_semctl (first, second, third, fourth); 353 return sys_semctl (first, second, third, fourth);
351 } 354 }