Skip to content

Commit

Permalink
VM_GROWS{UP,DOWN} shouldn't be set on shmem VMAs
Browse files Browse the repository at this point in the history
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Al Viro authored and torvalds committed Mar 5, 2012
1 parent 6414fa6 commit 835ee79
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mm/mmap.c
Expand Up @@ -1293,6 +1293,8 @@ unsigned long mmap_region(struct file *file, unsigned long addr,
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;
Expand Down

0 comments on commit 835ee79

Please sign in to comment.