ipc/shm: introduce new do_vma_munmap() to munmap
authorLiam R. Howlett <Liam.Howlett@oracle.com>
Thu, 26 Jan 2023 21:20:49 +0000 (16:20 -0500)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 10 Feb 2023 00:51:33 +0000 (16:51 -0800)
commit27b267011296e35dd5c983bf6c53b7230c78f383
treedf031321caa6afdd9ceb2f0781d220891e10c86c
parentd60beb1f698a429825ea2c463ee9e3dc3b1a79b7
ipc/shm: introduce new do_vma_munmap() to munmap

The shm already has the vma iterator in position for a write.
do_vmi_munmap() searches for the correct position and aligns the write, so
it is not the right function to use in this case.

The shm VMA tree modification is similar to the brk munmap situation, the
vma iterator is in position and the VMA is already known.  This patch
generalizes the brk munmap function do_brk_munmap() to be used for any
other callers with the vma iterator already in position to munmap a VMA.

Link: https://lkml.kernel.org/r/20230126212049.980501-1-Liam.Howlett@oracle.com
Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Reported-by: Sven Schnelle <svens@linux.ibm.com>
Link: https://lore.kernel.org/linux-mm/yt9dh6wec21a.fsf@linux.ibm.com/
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/mm.h
ipc/shm.c
mm/mmap.c