[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <97ea66a4-54a0-68a3-c42b-f3c36c69768e@redhat.com>
Date: Tue, 31 Jan 2023 09:35:26 +0100
From: David Hildenbrand <david@...hat.com>
To: "Liam R. Howlett" <Liam.Howlett@...cle.com>,
maple-tree@...ts.infradead.org, linux-mm@...ck.org,
linux-kernel@...r.kernel.org,
Andrew Morton <akpm@...ux-foundation.org>,
linux-next@...r.kernel.org
Cc: Sanan Hasanov <sanan.hasanov@...ghts.ucf.edu>,
Matthew Wilcox <willy@...radead.org>,
Hugh Dickins <hughd@...gle.com>
Subject: Re: [PATCH] mm/mmap: Fix vma_merge() offset when expanding the next
vma
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@...ghts.ucf.edu>
> Link: https://lore.kernel.org/linux-mm/IA1PR07MB983017D2FBA174D2FF78CEB6ABCE9@IA1PR07MB9830.namprd07.prod.outlook.com/
> Cc: Matthew Wilcox <willy@...radead.org>
> Cc: David Hildenbrand <david@...hat.com>
> Cc: Hugh Dickins <hughd@...gle.com>
Fixes: ?
> Signed-off-by: Liam R. Howlett <Liam.Howlett@...cle.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@...hat.com>
Thanks!
--
Thanks,
David / dhildenb
Powered by blists - more mailing lists