]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mm: Replace vma on split_vma() calls.
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>
Wed, 11 May 2022 14:46:53 +0000 (10:46 -0400)
commit8781070c8315a98dfcf730f5841533cf1f46ed51
tree1d330315ec8e7bba9f08d138303f854d26efc34b
parent799a6ab53e0446b5f46db97b40b66e38fc40156e
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