summaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel/sys_sh.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-04-21 17:16:14 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2009-04-21 17:16:14 +0200
commit81ca98036985559c49480007371af94aa6e85dc0 (patch)
tree1d4f400a40b573d1405ccd0a7d869e9859a30408 /arch/sh/kernel/sys_sh.c
parentMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/vir... (diff)
parentMerge branch 'sh/stable-updates' into sh/for-2.6.30 (diff)
downloadlinux-81ca98036985559c49480007371af94aa6e85dc0.tar.xz
linux-81ca98036985559c49480007371af94aa6e85dc0.zip
Merge branch 'sh/for-2.6.30' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6
* 'sh/for-2.6.30' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6: sh: Fix mmap2 for handling differing PAGE_SIZEs. sh: sh7723: Don't default enable the RTC clock. sh: sh7722: Don't default enable the RTC clock. rtc: rtc-sh: clock framework support.
Diffstat (limited to 'arch/sh/kernel/sys_sh.c')
-rw-r--r--arch/sh/kernel/sys_sh.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/sh/kernel/sys_sh.c b/arch/sh/kernel/sys_sh.c
index 58dfc02c7af1..e3a7e36639ef 100644
--- a/arch/sh/kernel/sys_sh.c
+++ b/arch/sh/kernel/sys_sh.c
@@ -63,6 +63,15 @@ asmlinkage long sys_mmap2(unsigned long addr, unsigned long len,
unsigned long prot, unsigned long flags,
unsigned long fd, unsigned long pgoff)
{
+ /*
+ * The shift for mmap2 is constant, regardless of PAGE_SIZE
+ * setting.
+ */
+ if (pgoff & ((1 << (PAGE_SHIFT - 12)) - 1))
+ return -EINVAL;
+
+ pgoff >>= PAGE_SHIFT - 12;
+
return do_mmap2(addr, len, prot, flags, fd, pgoff);
}