]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mm: Replace vma on split_vma() calls. maple_v5.18-rc2_lowmem
authorLiam R. Howlett <Liam.Howlett@oracle.com>
Tue, 12 Apr 2022 15:12:06 +0000 (11:12 -0400)
committerLiam R. Howlett <Liam.Howlett@oracle.com>
Thu, 28 Apr 2022 16:12:27 +0000 (12:12 -0400)
commitd5e398fd173a62da60450ed7cc7f0ba73a2582ea
treed7f7800c07914a582ef29cd6693e3f8b2e8d831e
parentef997fbd234b14fc954ab1eda08e6cb00fe88f11
mm: Replace vma on split_vma() calls.

When splitting a VMA, create two new VMAs to replace both parts of the
VMA.  Change the callers to pass in a pointer and update the pointer to
the new VMA based on the value of new_below.

do_mas_align_munmap() needed to update a local variable in the case of
splitting the end and only having one VMA to split.

mprotect_fixup() needed to change where it set the previous pointer to
after the split to avoid a use-after-free scenario.

Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
fs/userfaultfd.c
include/linux/mm.h
mm/madvise.c
mm/mempolicy.c
mm/mlock.c
mm/mmap.c
mm/mprotect.c