diff --git a/mm/mmap.c b/mm/mmap.c index e270057ed04ebef02909c6fdec089875f5909ae3..2def55555e05f10336802ae2f09c6a77a39e7e51 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -2852,6 +2852,9 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size, if (next->vm_flags != vma->vm_flags) goto out; + if (start + size <= next->vm_end) + break; + prev = next; }