Commit 4547e81c authored by Linus Torvalds's avatar Linus Torvalds Committed by Linus Torvalds

Dosemu actually wants to do a zero-sized source mremap

to generate the duplicate area at 0x0000 and 0x100000.

There's no downside to it, so allow it even though it's
a tad strange.
parent 4576b4fa
...@@ -315,8 +315,12 @@ unsigned long do_mremap(unsigned long addr, ...@@ -315,8 +315,12 @@ unsigned long do_mremap(unsigned long addr,
old_len = PAGE_ALIGN(old_len); old_len = PAGE_ALIGN(old_len);
new_len = PAGE_ALIGN(new_len); new_len = PAGE_ALIGN(new_len);
/* Don't allow the degenerate cases */ /*
if (!old_len || !new_len) * We allow a zero old-len as a special case
* for DOS-emu "duplicate shm area" thing. But
* a zero new-len is nonsensical.
*/
if (!new_len)
goto out; goto out;
/* new_addr is only valid if MREMAP_FIXED is specified */ /* new_addr is only valid if MREMAP_FIXED is specified */
......
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