Skip to content

Commit b32574b

Browse files
author
Rafael Aquini
committed
nommu: pass NULL argument to vma_iter_prealloc()
JIRA: https://issues.redhat.com/browse/RHEL-84184 CVE: CVE-2024-53109 This patch is a backport of the following upstream commit: commit 247d720 Author: Hajime Tazaki <thehajime@gmail.com> Date: Sat Nov 9 07:28:34 2024 +0900 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/20241108222834.3625217-1-thehajime@gmail.com Fixes: b5df092 ("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: Rafael Aquini <raquini@redhat.com>
1 parent 86ca59c commit b32574b

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
@@ -563,7 +563,7 @@ static int delete_vma_from_mm(struct vm_area_struct *vma)
563563
VMA_ITERATOR(vmi, vma->vm_mm, vma->vm_start);
564564

565565
vma_iter_config(&vmi, vma->vm_start, vma->vm_end);
566-
if (vma_iter_prealloc(&vmi, vma)) {
566+
if (vma_iter_prealloc(&vmi, NULL)) {
567567
pr_warn("Allocation of vma tree for process %d failed\n",
568568
current->pid);
569569
return -ENOMEM;

0 commit comments

Comments
 (0)