From: Al Viro Date: Mon, 5 Mar 2012 06:39:47 +0000 (+0000) Subject: VM_GROWS{UP,DOWN} shouldn't be set on shmem VMAs X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=835ee7978cb47de94cf70232a694f19295d2993f;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git VM_GROWS{UP,DOWN} shouldn't be set on shmem VMAs Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- diff --git a/mm/mmap.c b/mm/mmap.c index 3f758c7f4c81..22e1a0b2f70c 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -1293,6 +1293,8 @@ munmap_back: pgoff = vma->vm_pgoff; vm_flags = vma->vm_flags; } else if (vm_flags & VM_SHARED) { + if (unlikely(vm_flags & (VM_GROWSDOWN|VM_GROWSUP))) + goto free_vma; error = shmem_zero_setup(vma); if (error) goto free_vma;