summaryrefslogtreecommitdiff
path: root/mm/mmap.c
diff options
context:
space:
mode:
authorBen Hutchings <ben@decadent.org.uk>2023-06-22 21:24:30 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2023-06-24 14:12:58 -0700
commit8b35ca3e45e35a26a21427f35d4093606e93ad0a (patch)
treea5e755ba10e7ebfc8770ae4f247aaad5cf831e58 /mm/mmap.c
parent7267ef7b0b77f4ed23b7b3c87d8eca7bd9c2d007 (diff)
arm/mm: Convert to using lock_mm_and_find_vma()
arm has an additional check for address < FIRST_USER_ADDRESS before expanding the stack. Since FIRST_USER_ADDRESS is defined everywhere (generally as 0), move that check to the generic expand_downwards(). Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/mmap.c')
-rw-r--r--mm/mmap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/mmap.c b/mm/mmap.c
index d600404580b2..6d120bf1d0bc 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -2036,7 +2036,7 @@ int expand_downwards(struct vm_area_struct *vma, unsigned long address)
int error = 0;
address &= PAGE_MASK;
- if (address < mmap_min_addr)
+ if (address < mmap_min_addr || address < FIRST_USER_ADDRESS)
return -EPERM;
/* Enforce stack_guard_gap */