[ Sasha's backport helper bot ]
Hi,
Summary of potential issues: ⚠️ Found matching upstream commit but patch is missing proper reference to it
Found matching upstream commit: 0cf4b1687a187ba9247c71721d8b064634eda1f7
Status in newer kernel trees: 6.15.y | Present (different SHA1: b07a09cf2a1c)
Note: The patch differs from the upstream commit: --- 1: 0cf4b1687a187 ! 1: 2e6afa970267d mm/vma: reset VMA iterator on commit_merge() OOM failure @@ Commit message Cc: Jann Horn jannh@google.com Cc: stable@vger.kernel.org Signed-off-by: Andrew Morton akpm@linux-foundation.org + (cherry picked from commit 0cf4b1687a187ba9247c71721d8b064634eda1f7) + Signed-off-by: Lorenzo Stoakes lorenzo.stoakes@oracle.com
## mm/vma.c ## -@@ mm/vma.c: static __must_check struct vm_area_struct *vma_merge_existing_range( - err = dup_anon_vma(next, middle, &anon_dup); +@@ mm/vma.c: static struct vm_area_struct *vma_merge_existing_range(struct vma_merge_struct * + err = dup_anon_vma(next, vma, &anon_dup); }
- if (err) -+ if (err || commit_merge(vmg)) - goto abort; - -- err = commit_merge(vmg); -- if (err) { -- VM_WARN_ON(err != -ENOMEM); +- goto abort; - + /* + * In nearly all cases, we expand vmg->vma. There is one exception - + * merge_right where we partially span the VMA. In this case we shrink +@@ mm/vma.c: static struct vm_area_struct *vma_merge_existing_range(struct vma_merge_struct * + */ + expanded = !merge_right || merge_will_delete_vma; + +- if (commit_merge(vmg, adjust, +- merge_will_delete_vma ? vma : NULL, +- merge_will_delete_next ? next : NULL, +- adj_start, expanded)) { - if (anon_dup) - unlink_anon_vmas(anon_dup); - @@ mm/vma.c: static __must_check struct vm_area_struct *vma_merge_existing_range( - vmg->state = VMA_MERGE_ERROR_NOMEM; - return NULL; - } -- - khugepaged_enter_vma(vmg->target, vmg->flags); - vmg->state = VMA_MERGE_SUCCESS; - return vmg->target; -@@ mm/vma.c: static __must_check struct vm_area_struct *vma_merge_existing_range( ++ if (err || commit_merge(vmg, adjust, ++ merge_will_delete_vma ? vma : NULL, ++ merge_will_delete_next ? next : NULL, ++ adj_start, expanded)) ++ goto abort; + + res = merge_left ? prev : next; + khugepaged_enter_vma(res, vmg->flags); +@@ mm/vma.c: static struct vm_area_struct *vma_merge_existing_range(struct vma_merge_struct * vma_iter_set(vmg->vmi, start); vma_iter_load(vmg->vmi);
---
Results of testing on various branches:
| Branch | Patch Apply | Build Test | |---------------------------|-------------|------------| | stable/linux-6.12.y | Success | Success |