From 1b1cc14d7841ecff87ce2a78e6ec6b65a4044eb6 Mon Sep 17 00:00:00 2001 From: "Liam R. Howlett" Date: Fri, 28 Feb 2020 12:09:32 -0500 Subject: [PATCH] mmap: Write changes to next to the maple tree. When mprotect case 4 is hit (expand next back over vma), you have to write the changes to the maple tree or there will be a missing mapping. Signed-off-by: Liam R. Howlett --- mm/mmap.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mm/mmap.c b/mm/mmap.c index 0a741e5bd55e..0fe9c8ae6a64 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -1060,8 +1060,7 @@ again: if (adjust_next) { next->vm_start += adjust_next; next->vm_pgoff += adjust_next >> PAGE_SHIFT; - // maple tree erase/store is unnecessary as the adjusting of - // the vma would have overwritten the area. + __vma_mt_store(mm, next); } if (file) { -- 2.50.1