summaryrefslogtreecommitdiff
path: root/arch/score
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2009-12-11 14:48:57 +0300
committerAl Viro <viro@zeniv.linux.org.uk>2009-12-11 14:48:57 +0300
commitaa65607373a4daf2010e8c3867b6317619f3c1a3 (patch)
tree8a221e60d97cdfa2064df53f7da3061a18add7a2 /arch/score
parente77414e0aad6a1b063ba5e5750c582c75327ea6a (diff)
downloadlinux-aa65607373a4daf2010e8c3867b6317619f3c1a3.tar.xz
Add missing alignment check in arch/score sys_mmap()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch/score')
-rw-r--r--arch/score/kernel/sys_score.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/score/kernel/sys_score.c b/arch/score/kernel/sys_score.c
index 3d6a67dd628c..856ed68a58e6 100644
--- a/arch/score/kernel/sys_score.c
+++ b/arch/score/kernel/sys_score.c
@@ -41,10 +41,11 @@ sys_mmap2(unsigned long addr, unsigned long len, unsigned long prot,
asmlinkage long
sys_mmap(unsigned long addr, unsigned long len, unsigned long prot,
- unsigned long flags, unsigned long fd, off_t pgoff)
+ unsigned long flags, unsigned long fd, off_t offset)
{
- /* where's the alignment check? */
- return sys_mmap_pgoff(addr, len, prot, flags, fd, pgoff >> PAGE_SHIFT);
+ if (unlikely(offset & ~PAGE_MASK))
+ return -EINVAL;
+ return sys_mmap_pgoff(addr, len, prot, flags, fd, offset >> PAGE_SHIFT);
}
asmlinkage long