From dab7c0b31e13e3687e07e790a1e8d665490ce391 Mon Sep 17 00:00:00 2001 From: "Liam R. Howlett" Date: Tue, 24 Nov 2020 14:36:27 -0500 Subject: [PATCH] mm/mmap: Fix mmap_region() potential issue Signed-off-by: Liam R. Howlett --- mm/mmap.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mm/mmap.c b/mm/mmap.c index be3f3be2604c..b63175faa39b 100644 --- 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 -- 2.50.1