commit: 9b61a4d1b2064dbd0c9e61754305ac852170509f
From: Russell King <[email protected]>
Date: Wed, 16 May 2012 15:19:20 +0100
Subject: ARM: prevent VM_GROWSDOWN mmaps extending below FIRST_USER_ADDRESS

Cc: <[email protected]>
Reported-by: Al Viro <[email protected]>
Signed-off-by: Russell King <[email protected]>
---
 arch/arm/mm/fault.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c
index f074675..5bb4835 100644
--- a/arch/arm/mm/fault.c
+++ b/arch/arm/mm/fault.c
@@ -247,7 +247,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;
-- 
1.7.3.4
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to