mm: mremap: validate input before taking lock
This patch is very similar to
84d96d897671 ("mm: madvise: complete input
validation before taking lock"): perform some basic validation of the
input to mremap() before taking the ¤t->mm->mmap_sem lock. This
also makes the MREMAP_FIXED => MREMAP_MAYMOVE dependency slightly more
explicit.
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>