提交 58163393 编写于 作者: D David S. Miller

sparc: Fix mmap VA span checking.

We should not conditionalize VA range checks on MAP_FIXED.
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 d45100f7
......@@ -223,8 +223,7 @@ int sparc_mmap_check(unsigned long addr, unsigned long len, unsigned long flags)
{
if (ARCH_SUN4C_SUN4 &&
(len > 0x20000000 ||
((flags & MAP_FIXED) &&
addr < 0xe0000000 && addr + len > 0x20000000)))
(addr < 0xe0000000 && addr + len > 0x20000000)))
return -EINVAL;
/* See asm-sparc/uaccess.h */
......
......@@ -549,13 +549,13 @@ int sparc64_mmap_check(unsigned long addr, unsigned long len,
if (len >= STACK_TOP32)
return -EINVAL;
if ((flags & MAP_FIXED) && addr > STACK_TOP32 - len)
if (addr > STACK_TOP32 - len)
return -EINVAL;
} else {
if (len >= VA_EXCLUDE_START)
return -EINVAL;
if ((flags & MAP_FIXED) && invalid_64bit_range(addr, len))
if (invalid_64bit_range(addr, len))
return -EINVAL;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册