linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: "Liam R. Howlett" <Liam.Howlett@oracle.com>,
	maple-tree@lists.infradead.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-next@vger.kernel.org
Cc: Sanan Hasanov <sanan.hasanov@knights.ucf.edu>,
	Matthew Wilcox <willy@infradead.org>,
	Hugh Dickins <hughd@google.com>
Subject: Re: [PATCH] mm/mmap: Fix vma_merge() offset when expanding the next vma
Date: Tue, 31 Jan 2023 09:35:26 +0100	[thread overview]
Message-ID: <97ea66a4-54a0-68a3-c42b-f3c36c69768e@redhat.com> (raw)
In-Reply-To: <20230130195713.2881766-1-Liam.Howlett@oracle.com>

On 30.01.23 20:57, Liam R. Howlett wrote:
> The vm_pgoff was being set incorrectly when expanding the next VMA to a
> lower address.  Fix the issue by using the mid->vm_pgoff value for this
> merge case (aka case 8).  Note that this does not change case 3's
> vm_pgoff as next and mid are the same VMA.
> 
> Reported-by: Sanan Hasanov <sanan.hasanov@knights.ucf.edu>
> Link: https://lore.kernel.org/linux-mm/IA1PR07MB983017D2FBA174D2FF78CEB6ABCE9@IA1PR07MB9830.namprd07.prod.outlook.com/
> Cc: Matthew Wilcox <willy@infradead.org>
> Cc: David Hildenbrand <david@redhat.com>
> Cc: Hugh Dickins <hughd@google.com>

Fixes: ?

> Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
> ---
>   mm/mmap.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/mmap.c b/mm/mmap.c
> index 00d90bbc250e..614ea2d93b0a 100644
> --- a/mm/mmap.c
> +++ b/mm/mmap.c
> @@ -978,7 +978,7 @@ struct vm_area_struct *vma_merge(struct vma_iterator *vmi, struct mm_struct *mm,
>   			vma = next;			/* case 3 */
>   			vma_start = addr;
>   			vma_end = next->vm_end;
> -			vma_pgoff = next->vm_pgoff;
> +			vma_pgoff = mid->vm_pgoff;
>   			err = 0;
>   			if (mid != next) {		/* case 8 */
>   				remove = mid;

Acked-by: David Hildenbrand <david@redhat.com>

Thanks!

-- 
Thanks,

David / dhildenb



  reply	other threads:[~2023-01-31  8:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-30 19:57 Liam R. Howlett
2023-01-31  8:35 ` David Hildenbrand [this message]
2023-01-31 14:24   ` Liam R. Howlett
2023-01-31 14:29     ` David Hildenbrand
2023-01-31 21:07       ` Andrew Morton

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=97ea66a4-54a0-68a3-c42b-f3c36c69768e@redhat.com \
    --to=david@redhat.com \
    --cc=Liam.Howlett@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=hughd@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-next@vger.kernel.org \
    --cc=maple-tree@lists.infradead.org \
    --cc=sanan.hasanov@knights.ucf.edu \
    --cc=willy@infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox