From bdff47e3b07f206a03911aba5d6990543ba2f1c3 Mon Sep 17 00:00:00 2001 From: "Liam R. Howlett" Date: Wed, 17 Feb 2021 17:15:37 -0500 Subject: [PATCH] mm/mprotect: Use vma_next() instead of mas_next(). mas is in the wrong state and would potentially return the current vma twice. Signed-off-by: Liam R. Howlett --- mm/mprotect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/mprotect.c b/mm/mprotect.c index 676224803726..6dbd5f685ffb 100644 --- a/mm/mprotect.c +++ b/mm/mprotect.c @@ -634,7 +634,7 @@ static int do_mprotect_pkey(unsigned long start, size_t len, if (nstart >= end) goto out; - vma = mas_next(&mas, ULONG_MAX); + vma = vma_next(current->mm, vma); if (!vma || vma->vm_start != nstart) { error = -ENOMEM; goto out; -- 2.50.1