summaryrefslogtreecommitdiff
path: root/mm
diff options
context:
space:
mode:
authorHajime Tazaki <thehajime@gmail.com>2024-11-09 01:28:34 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-11-22 17:38:34 +0300
commit8bbf0ab631cdf1dade6745f137cff98751e6ced7 (patch)
treecd670f07f6d15a85ab6813ccbd250d4fb0da336b /mm
parent59b49ca67cca7b007a5afd3de0283c8008157665 (diff)
downloadlinux-8bbf0ab631cdf1dade6745f137cff98751e6ced7.tar.xz
nommu: pass NULL argument to vma_iter_prealloc()
commit 247d720b2c5d22f7281437fd6054a138256986ba upstream. 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/20241108222834.3625217-1-thehajime@gmail.com Fixes: b5df09226450 ("mm: set up vma iterator for vma_iter_prealloc() calls") Signed-off-by: Hajime Tazaki <thehajime@gmail.com> Reviewed-by: Liam R. Howlett <Liam.Howlett@Oracle.com> Cc: <stable@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/nommu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/nommu.c b/mm/nommu.c
index 7f9e9e5a0e12..5816b15eeb2b 100644
--- a/mm/nommu.c
+++ b/mm/nommu.c
@@ -584,7 +584,7 @@ static int delete_vma_from_mm(struct vm_area_struct *vma)
VMA_ITERATOR(vmi, vma->vm_mm, vma->vm_start);
vma_iter_config(&vmi, vma->vm_start, vma->vm_end);
- if (vma_iter_prealloc(&vmi, vma)) {
+ if (vma_iter_prealloc(&vmi, NULL)) {
pr_warn("Allocation of vma tree for process %d failed\n",
current->pid);
return -ENOMEM;