The quilt patch titled Subject: mm/mremap: fix vma iterator initialization has been removed from the -mm tree. Its filename was mm-change-munmap-splitting-order-and-move_vma-fix.patch This patch was dropped because it was folded into mm-change-munmap-splitting-order-and-move_vma.patch ------------------------------------------------------ From: "Liam R. Howlett" <Liam.Howlett@xxxxxxxxxx> Subject: mm/mremap: fix vma iterator initialization Date: Thu, 26 Jan 2023 16:20:11 -0500 The vma iterator location is incorrect when there is a failure in the move_vma() function which alters the address being modified. Delay the initialization of the vma iterator until the address is stable. Link: https://lkml.kernel.org/r/20230126212011.980350-1-Liam.Howlett@xxxxxxxxxx Signed-off-by: Liam R. Howlett <Liam.Howlett@xxxxxxxxxx> Reported-by: Sanan Hasanov <sanan.hasanov@xxxxxxxxxxxxxxx> Link: https://lore.kernel.org/linux-mm/IA1PR07MB98306BC0F55667A760EABE91ABCE9@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/ Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- --- a/mm/mremap.c~mm-change-munmap-splitting-order-and-move_vma-fix +++ a/mm/mremap.c @@ -585,7 +585,7 @@ static unsigned long move_vma(struct vm_ unsigned long hiwater_vm; int err = 0; bool need_rmap_locks; - VMA_ITERATOR(vmi, mm, old_addr); + struct vma_iterator vmi; /* * We'd prefer to avoid failure later on in do_munmap: @@ -701,6 +701,7 @@ static unsigned long move_vma(struct vm_ return new_addr; } + vma_iter_init(&vmi, mm, old_addr); if (do_vmi_munmap(&vmi, mm, old_addr, old_len, uf_unmap, false) < 0) { /* OOM: unable to split vma, just get accounts right */ if (vm_flags & VM_ACCOUNT && !(flags & MREMAP_DONTUNMAP)) _ Patches currently in -mm which might be from Liam.Howlett@xxxxxxxxxx are maple_tree-fix-handle-of-invalidated-state-in-mas_wr_store_setup.patch maple_tree-fix-mas_prev-and-mas_find-state-handling.patch ipc-shm-introduce-new-do_vma_munmap-to-munmap.patch nommu-pass-through-vma-iterator-to-shrink_vma.patch mm-damon-vaddr-testh-stop-using-vma_mas_store-for-maple-tree-store.patch mm-change-munmap-splitting-order-and-move_vma.patch mm-mremap-convert-vma_adjust-to-vma_expand.patch mm-mmap-remove-__vma_adjust-fix.patch