diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2009-12-11 06:48:57 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2009-12-11 06:48:57 -0500 |
commit | aa65607373a4daf2010e8c3867b6317619f3c1a3 (patch) | |
tree | 8a221e60d97cdfa2064df53f7da3061a18add7a2 /arch/score | |
parent | e77414e0aad6a1b063ba5e5750c582c75327ea6a (diff) |
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.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/score/kernel/sys_score.c b/arch/score/kernel/sys_score.c index 3d6a67dd628..856ed68a58e 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 |