aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/kernel/syscall.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2006-02-25 00:20:29 -0500
committerRalf Baechle <ralf@linux-mips.org>2006-03-21 08:27:48 -0500
commit947df17cb1be4c7239280a77263c249fde1379ef (patch)
tree1e32d0e81848e59a9796c3034208aa72432583d0 /arch/mips/kernel/syscall.c
parentde862b488e81172d4c610945efd9f3fc7f4b84a7 (diff)
[MIPS] sys_mmap2 offset argument should always be shifted 12, not PAGE_SHIFT.
This patch adjusts the offset argument passed into sys_mmap2 to be always shifted 12, even when the native page size isn't 4K. This is what all existing userspace libraries expect. Signed-off-by: H. Peter Anvin <hpa@zytor.com> Signed-off-by: Ralf Baechle <ralf@linux-mips.org> ---
Diffstat (limited to 'arch/mips/kernel/syscall.c')
-rw-r--r--arch/mips/kernel/syscall.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/mips/kernel/syscall.c b/arch/mips/kernel/syscall.c
index 55f2bc09529c..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);