]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
maple_tree: Fix find_vma_intersction() cache update with possible incorrect addr
authorLiam R. Howlett <Liam.Howlett@Oracle.com>
Fri, 9 Oct 2020 19:12:59 +0000 (15:12 -0400)
committerLiam R. Howlett <Liam.Howlett@Oracle.com>
Tue, 5 Jan 2021 17:30:34 +0000 (12:30 -0500)
Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
mm/mmap.c

index 1bfdf6492be797bcd643db6db8e3a66590db65ba..ba93cf9e3816f00322878d64486b598736546426 100644 (file)
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -2110,13 +2110,14 @@ struct vm_area_struct *find_vma_intersection(struct mm_struct *mm,
                                             unsigned long end_addr)
 {
        struct vm_area_struct *vma;
+       unsigned long addr = start_addr;
 
        /* Check the cache first. */
        vma = vmacache_find(mm, start_addr);
        if (likely(vma))
                return vma;
 
-       vma = mt_find(&mm->mm_mt, &start_addr, end_addr - 1);
+       vma = mt_find(&mm->mm_mt, &addr, end_addr - 1);
        if (vma)
                vmacache_update(start_addr, vma);