Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 21981
b: refs/heads/master
c: 947df17
h: refs/heads/master
i:
  21979: d9e2d73
v: v3
  • Loading branch information
H. Peter Anvin authored and Ralf Baechle committed Mar 21, 2006
1 parent 5c5e0d1 commit 7d83cfd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: de862b488e81172d4c610945efd9f3fc7f4b84a7
refs/heads/master: 947df17cb1be4c7239280a77263c249fde1379ef
4 changes: 4 additions & 0 deletions trunk/arch/mips/kernel/linux32.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ sys32_mmap2(unsigned long addr, unsigned long len, unsigned long prot,
unsigned long error;

error = -EINVAL;
if (pgoff & (~PAGE_MASK >> 12))
goto out;
pgoff >>= PAGE_SHIFT-12;

if (!(flags & MAP_ANONYMOUS)) {
error = -EBADF;
file = fget(fd);
Expand Down
5 changes: 4 additions & 1 deletion trunk/arch/mips/kernel/syscall.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,10 @@ asmlinkage unsigned long
sys_mmap2(unsigned long addr, unsigned long len, unsigned long prot,
unsigned long flags, unsigned long fd, unsigned long pgoff)
{
return do_mmap2(addr, len, prot, flags, fd, pgoff);
if (pgoff & (~PAGE_MASK >> 12))
return -EINVAL;

return do_mmap2(addr, len, prot, flags, fd, pgoff >> (PAGE_SHIFT-12));
}

save_static_function(sys_fork);
Expand Down

0 comments on commit 7d83cfd

Please sign in to comment.