]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ARM: prevent VM_GROWSDOWN mmaps extending below FIRST_USER_ADDRESS
authorRussell King <rmk+kernel@arm.linux.org.uk>
Wed, 16 May 2012 14:19:20 +0000 (15:19 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 21 May 2012 17:46:18 +0000 (10:46 -0700)
commit 9b61a4d1b2064dbd0c9e61754305ac852170509f upstream.

Reported-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm/mm/fault.c

index bb7eac381a8e60f619591e7c80c4ad30cc972d62..90e366a133e3644a03de0216c841b035a1d1fb10 100644 (file)
@@ -245,7 +245,9 @@ good_area:
        return handle_mm_fault(mm, vma, addr & PAGE_MASK, flags);
 
 check_stack:
-       if (vma->vm_flags & VM_GROWSDOWN && !expand_stack(vma, addr))
+       /* Don't allow expansion below FIRST_USER_ADDRESS */
+       if (vma->vm_flags & VM_GROWSDOWN &&
+           addr >= FIRST_USER_ADDRESS && !expand_stack(vma, addr))
                goto good_area;
 out:
        return fault;