summaryrefslogtreecommitdiffstats
path: root/arch/arm/mm/fault.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2012-05-16 16:19:20 +0200
committerRussell King <rmk+kernel@arm.linux.org.uk>2012-05-16 16:20:59 +0200
commit9b61a4d1b2064dbd0c9e61754305ac852170509f (patch)
tree0665524aa0636b7615a49748e5ddff818a231d45 /arch/arm/mm/fault.c
parentARM: 7417/1: vfp: ensure preemption is disabled when enabling VFP access (diff)
downloadlinux-9b61a4d1b2064dbd0c9e61754305ac852170509f.tar.xz
linux-9b61a4d1b2064dbd0c9e61754305ac852170509f.zip
ARM: prevent VM_GROWSDOWN mmaps extending below FIRST_USER_ADDRESS
Cc: <stable@vger.kernel.org> Reported-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mm/fault.c')
-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 f07467533365..5bb48356d217 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;