Commit b52adf5b authored by Arun Sharma's avatar Arun Sharma Committed by David Mosberger

[PATCH] ia64: IA-32 support patch: mmap should return ENOMEM

Single Unix Specification says:
[ENOMEM] MAP_FIXED was specified, and the range [addr, addr + len) exceeds
that allowed for the address space of a process.

Therefore if addr + len > IA32_PAGE_OFFSET, we should return ENOMEM.
parent 25200143
...@@ -420,7 +420,12 @@ ia32_do_mmap (struct file *file, unsigned long addr, unsigned long len, int prot ...@@ -420,7 +420,12 @@ ia32_do_mmap (struct file *file, unsigned long addr, unsigned long len, int prot
return addr; return addr;
if (len > IA32_PAGE_OFFSET || addr > IA32_PAGE_OFFSET - len) if (len > IA32_PAGE_OFFSET || addr > IA32_PAGE_OFFSET - len)
{
if (flags & MAP_FIXED)
return -ENOMEM;
else
return -EINVAL; return -EINVAL;
}
if (OFFSET4K(offset)) if (OFFSET4K(offset))
return -EINVAL; return -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment