summaryrefslogtreecommitdiff
path: root/arch/arm
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2012-05-16 15:19:20 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-05-21 09:40:01 -0700
commitdbda13fc2193061009cd20998f64dd01a97309a9 (patch)
treea3b0ebbf5aae3e6e9c972604288acf444ea7453f /arch/arm
parent1c1cb5756a8d296bbc33fc844f97048dc09ee172 (diff)
ARM: prevent VM_GROWSDOWN mmaps extending below FIRST_USER_ADDRESS
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>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mm/fault.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c
index bc0e1d88fd3b..8799eae5da9b 100644
--- a/arch/arm/mm/fault.c
+++ b/arch/arm/mm/fault.c
@@ -266,7 +266,9 @@ good_area:
return fault;
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;