mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-28 21:46:02 -04:00
[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>
---
This commit is contained in:
committed by
Ralf Baechle
parent
de862b488e
commit
947df17cb1
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user