diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-05-16 15:19:20 +0100 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2012-05-20 22:56:49 +0100 |
commit | 6d4e481b77c311118d1cab9356e781ba56047f16 (patch) | |
tree | 38c0944acb64190d8f3d11a72aa9e718da0eeee6 /arch/arm | |
parent | b31a26af02788341aa8b9b1490ca30fb0bc47389 (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: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'arch/arm')
-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 aa33949fef60..4b0bc37b943d 100644 --- a/arch/arm/mm/fault.c +++ b/arch/arm/mm/fault.c @@ -267,7 +267,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; |