提交 d11cf326 编写于 作者: Z Zhang Yanmin 提交者: Tony Luck

[IA64] sys_mmap doesn't follow posix.1 when parameter len=0

In IA64 kernel, sys_mmap calls do_mmap2 and do_mmap2 returns addr if
len=0, which means the mmap sys call succeeds.

Posix.1 says:
The mmap() function shall fail if:
[EINVAL] The value of len is zero. 

Here is a patch to fix it.
Signed-off-by: NZhang Yanmin <yanmin.zhang@intel.com>
Acked-by: NDavid Mosberger <davidm@hpl.hp.com>
Signed-off-by: NTony Luck <tony.luck@intel.com>
上级 fe12e25e
......@@ -182,13 +182,6 @@ do_mmap2 (unsigned long addr, unsigned long len, int prot, int flags, int fd, un
}
}
/*
* A zero mmap always succeeds in Linux, independent of whether or not the
* remaining arguments are valid.
*/
if (len == 0)
goto out;
/* Careful about overflows.. */
len = PAGE_ALIGN(len);
if (!len || len > TASK_SIZE) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册