]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
mm/mprotect: Use vma_next() of prev.
authorLiam R. Howlett <Liam.Howlett@Oracle.com>
Thu, 18 Feb 2021 14:24:49 +0000 (09:24 -0500)
committerLiam R. Howlett <Liam.Howlett@Oracle.com>
Thu, 18 Feb 2021 14:24:49 +0000 (09:24 -0500)
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 <Liam.Howlett@Oracle.com>
mm/mprotect.c

index 6dbd5f685ffb0e1f56c8a6232d62aa0828c499e3..0ecc4fbee3327723e13b9dd5f87e7047d74c4d84 100644 (file)
@@ -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;