Skip to content

Commit 247d720

Browse files
thehajimeakpm00
authored andcommitted
nommu: pass NULL argument to vma_iter_prealloc()
When deleting a vma entry from a maple tree, it has to pass NULL to vma_iter_prealloc() in order to calculate internal state of the tree, but it passed a wrong argument. As a result, nommu kernels crashed upon accessing a vma iterator, such as acct_collect() reading the size of vma entries after do_munmap(). This commit fixes this issue by passing a right argument to the preallocation call. Link: https://lkml.kernel.org/r/[email protected] Fixes: b5df092 ("mm: set up vma iterator for vma_iter_prealloc() calls") Signed-off-by: Hajime Tazaki <[email protected]> Reviewed-by: Liam R. Howlett <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 23aab03 commit 247d720

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mm/nommu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ static int delete_vma_from_mm(struct vm_area_struct *vma)
573573
VMA_ITERATOR(vmi, vma->vm_mm, vma->vm_start);
574574

575575
vma_iter_config(&vmi, vma->vm_start, vma->vm_end);
576-
if (vma_iter_prealloc(&vmi, vma)) {
576+
if (vma_iter_prealloc(&vmi, NULL)) {
577577
pr_warn("Allocation of vma tree for process %d failed\n",
578578
current->pid);
579579
return -ENOMEM;

0 commit comments

Comments
 (0)