mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-12-27 10:01:39 -05:00
ipc/shm, mm: drop do_vma_munmap()
The do_vma_munmap() wrapper existed for callers that didn't have a vma iterator and needed to check the vma mseal status prior to calling the underlying munmap(). All callers now use a vma iterator and since the mseal check has been moved to do_vmi_align_munmap() and the vmas are aligned, this function can just be called instead. do_vmi_align_munmap() can no longer be static as ipc/shm is using it and it is exported via the mm.h header. Link: https://lkml.kernel.org/r/20240830040101.822209-19-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com> Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com> Cc: Bert Karwatzki <spasswolf@web.de> Cc: Jeff Xu <jeffxu@chromium.org> Cc: Jiri Olsa <olsajiri@gmail.com> Cc: Kees Cook <kees@kernel.org> Cc: Lorenzo Stoakes <lstoakes@gmail.com> Cc: Mark Brown <broonie@kernel.org> Cc: Matthew Wilcox <willy@infradead.org> Cc: "Paul E. McKenney" <paulmck@kernel.org> Cc: Paul Moore <paul@paul-moore.com> Cc: Sidhartha Kumar <sidhartha.kumar@oracle.com> Cc: Suren Baghdasaryan <surenb@google.com> Cc: Vlastimil Babka <vbabka@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
committed by
Andrew Morton
parent
13d77e0133
commit
63fc66f5b6
@@ -1778,8 +1778,8 @@ long ksys_shmdt(char __user *shmaddr)
|
||||
*/
|
||||
file = vma->vm_file;
|
||||
size = i_size_read(file_inode(vma->vm_file));
|
||||
do_vma_munmap(&vmi, vma, vma->vm_start, vma->vm_end,
|
||||
NULL, false);
|
||||
do_vmi_align_munmap(&vmi, vma, mm, vma->vm_start,
|
||||
vma->vm_end, NULL, false);
|
||||
/*
|
||||
* We discovered the size of the shm segment, so
|
||||
* break out of here and fall through to the next
|
||||
@@ -1803,8 +1803,8 @@ long ksys_shmdt(char __user *shmaddr)
|
||||
if ((vma->vm_ops == &shm_vm_ops) &&
|
||||
((vma->vm_start - addr)/PAGE_SIZE == vma->vm_pgoff) &&
|
||||
(vma->vm_file == file)) {
|
||||
do_vma_munmap(&vmi, vma, vma->vm_start, vma->vm_end,
|
||||
NULL, false);
|
||||
do_vmi_align_munmap(&vmi, vma, mm, vma->vm_start,
|
||||
vma->vm_end, NULL, false);
|
||||
}
|
||||
|
||||
vma = vma_next(&vmi);
|
||||
|
||||
Reference in New Issue
Block a user