summaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorBen Hutchings <ben@decadent.org.uk>2023-06-22 21:24:30 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-07-01 13:16:25 +0200
commit1f4197f050dec016783663682b9eccbb603befa7 (patch)
tree32b15420e2c57cde158635302e1f093d0e5470c7 /mm
parentac764deea709b4d13fa78265cb2ec463da05a5d6 (diff)
downloadlinux-stable-1f4197f050dec016783663682b9eccbb603befa7.tar.gz
linux-stable-1f4197f050dec016783663682b9eccbb603befa7.tar.bz2
linux-stable-1f4197f050dec016783663682b9eccbb603befa7.zip
arm/mm: Convert to using lock_mm_and_find_vma()
commit 8b35ca3e45e35a26a21427f35d4093606e93ad0a upstream. 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> Signed-off-by: Samuel Mendoza-Jonas <samjonas@amazon.com> Signed-off-by: David Woodhouse <dwmw@amazon.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/mmap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/mmap.c b/mm/mmap.c
index f031fa267913..fc7d09d81de1 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -2045,7 +2045,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 */