All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: stable@vger.kernel.org, lorenzo.stoakes@oracle.com
Cc: Sasha Levin <sashal@kernel.org>
Subject: Re: [PATCH 6.12.y] mm/vma: reset VMA iterator on commit_merge() OOM failure
Date: Mon, 30 Jun 2025 21:15:27 -0400	[thread overview]
Message-ID: <20250630185452-e7a223d4b65c00a5@stable.kernel.org> (raw)
In-Reply-To: <20250630175817.164918-1-lorenzo.stoakes@oracle.com>

[ 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   |

      reply	other threads:[~2025-07-01  1:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-20 15:11 FAILED: patch "[PATCH] mm/vma: reset VMA iterator on commit_merge() OOM failure" failed to apply to 6.12-stable tree gregkh
2025-06-30 17:58 ` [PATCH 6.12.y] mm/vma: reset VMA iterator on commit_merge() OOM failure Lorenzo Stoakes
2025-07-01  1:15   ` Sasha Levin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250630185452-e7a223d4b65c00a5@stable.kernel.org \
    --to=sashal@kernel.org \
    --cc=lorenzo.stoakes@oracle.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.