diff options
author | 2013-09-16 07:46:23 +0200 | |
---|---|---|
committer | 2013-11-08 15:20:44 +0100 | |
commit | 99399545d62533b4ae742190b5c6b11f7a5826d9 (patch) | |
tree | d7f6ab88f9a71f301ad5294d1572c939a2155b70 /arch/microblaze/kernel/sys_microblaze.c | |
parent | microblaze: Use predefined SYSCALL_DEFINE macro (diff) | |
download | linux-99399545d62533b4ae742190b5c6b11f7a5826d9.tar.gz linux-99399545d62533b4ae742190b5c6b11f7a5826d9.tar.bz2 linux-99399545d62533b4ae742190b5c6b11f7a5826d9.zip |
microblaze: Fix bug with mmap2 syscall MB implementation
Fix mmap2 behaviour which incorrectly works with pgoff
not in 4k units.
Reported-by: Rich Felker <dalias@aerifal.cx>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Diffstat (limited to 'arch/microblaze/kernel/sys_microblaze.c')
-rw-r--r-- | arch/microblaze/kernel/sys_microblaze.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/microblaze/kernel/sys_microblaze.c b/arch/microblaze/kernel/sys_microblaze.c index e80a6c02ac31..f1e1f666ddde 100644 --- a/arch/microblaze/kernel/sys_microblaze.c +++ b/arch/microblaze/kernel/sys_microblaze.c @@ -42,3 +42,14 @@ SYSCALL_DEFINE6(mmap, unsigned long, addr, unsigned long, len, return sys_mmap_pgoff(addr, len, prot, flags, fd, pgoff >> PAGE_SHIFT); } + +SYSCALL_DEFINE6(mmap2, unsigned long, addr, unsigned long, len, + unsigned long, prot, unsigned long, flags, unsigned long, fd, + unsigned long, pgoff) +{ + if (pgoff & (~PAGE_MASK >> 12)) + return -EINVAL; + + return sys_mmap_pgoff(addr, len, prot, flags, fd, + pgoff >> (PAGE_SHIFT - 12)); +} |