From 8930eddeac4d1e32f82d1911c1f4ce099b0cd788 Mon Sep 17 00:00:00 2001 From: "Liam R. Howlett" Date: Thu, 18 Feb 2021 09:24:49 -0500 Subject: [PATCH] mm/mprotect: Use vma_next() of prev. The linked list used to use prev->next. the maple state may be invalidated by the mprotect_fixup call which may alter the tree. 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 6dbd5f685ffb..0ecc4fbee332 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 = vma_next(current->mm, vma); + vma = vma_next(current->mm, prev); if (!vma || vma->vm_start != nstart) { error = -ENOMEM; goto out; -- 2.50.1