Commit 835ee797 authored by Al Viro's avatar Al Viro Committed by Linus Torvalds

VM_GROWS{UP,DOWN} shouldn't be set on shmem VMAs

Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 6414fa6a
...@@ -1293,6 +1293,8 @@ unsigned long mmap_region(struct file *file, unsigned long addr, ...@@ -1293,6 +1293,8 @@ unsigned long mmap_region(struct file *file, unsigned long addr,
pgoff = vma->vm_pgoff; pgoff = vma->vm_pgoff;
vm_flags = vma->vm_flags; vm_flags = vma->vm_flags;
} else if (vm_flags & VM_SHARED) { } else if (vm_flags & VM_SHARED) {
if (unlikely(vm_flags & (VM_GROWSDOWN|VM_GROWSUP)))
goto free_vma;
error = shmem_zero_setup(vma); error = shmem_zero_setup(vma);
if (error) if (error)
goto free_vma; goto free_vma;
......
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