diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-05-16 10:19:20 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-05-16 10:20:59 -0400 |
commit | 9b61a4d1b2064dbd0c9e61754305ac852170509f (patch) | |
tree | 0665524aa0636b7615a49748e5ddff818a231d45 /arch/arm/mm/fault.c | |
parent | 998de4acb2ba188d20768d1065658377a2e7d29b (diff) |
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.c | 4 |
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: | |||
247 | return handle_mm_fault(mm, vma, addr & PAGE_MASK, flags); | 247 | return handle_mm_fault(mm, vma, addr & PAGE_MASK, flags); |
248 | 248 | ||
249 | check_stack: | 249 | check_stack: |
250 | if (vma->vm_flags & VM_GROWSDOWN && !expand_stack(vma, addr)) | 250 | /* Don't allow expansion below FIRST_USER_ADDRESS */ |
251 | if (vma->vm_flags & VM_GROWSDOWN && | ||
252 | addr >= FIRST_USER_ADDRESS && !expand_stack(vma, addr)) | ||
251 | goto good_area; | 253 | goto good_area; |
252 | out: | 254 | out: |
253 | return fault; | 255 | return fault; |