]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
mm/mmap: Fix mmap_region() potential issue
authorLiam R. Howlett <Liam.Howlett@Oracle.com>
Tue, 24 Nov 2020 19:36:27 +0000 (14:36 -0500)
committerLiam R. Howlett <Liam.Howlett@Oracle.com>
Tue, 5 Jan 2021 17:31:27 +0000 (12:31 -0500)
Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
mm/mmap.c

index be3f3be2604c20d8fbeb8ad84f6a004e71346406..b63175faa39b14480ffb97dc5cf0167b795e6f9a 100644 (file)
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -1787,6 +1787,9 @@ unsigned long mmap_region(struct file *file, unsigned long addr,
                goto expanded;
        }
 
+       mas_reset(&mas);
+       mas_set(&mas, addr);
+       mas.last = end - 1;
 cannot_expand:
        /*
         * Determine the object being mapped and call the appropriate