提交 99399545 编写于 作者: M Michal Simek

microblaze: Fix bug with mmap2 syscall MB implementation

Fix mmap2 behaviour which incorrectly works with pgoff
not in 4k units.
Reported-by: NRich Felker <dalias@aerifal.cx>
Signed-off-by: NMichal Simek <michal.simek@xilinx.com>
上级 176195e7
...@@ -42,3 +42,14 @@ SYSCALL_DEFINE6(mmap, unsigned long, addr, unsigned long, len, ...@@ -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); 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));
}
...@@ -192,7 +192,7 @@ ENTRY(sys_call_table) ...@@ -192,7 +192,7 @@ ENTRY(sys_call_table)
.long sys_ni_syscall /* reserved for streams2 */ .long sys_ni_syscall /* reserved for streams2 */
.long sys_vfork /* 190 */ .long sys_vfork /* 190 */
.long sys_getrlimit .long sys_getrlimit
.long sys_mmap_pgoff /* mmap2 */ .long sys_mmap2
.long sys_truncate64 .long sys_truncate64
.long sys_ftruncate64 .long sys_ftruncate64
.long sys_stat64 /* 195 */ .long sys_stat64 /* 195 */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册