Эх сурвалжийг харах

[S390] pgtable_list corruption

After page_table_free_rcu removed a page from the pgtable_list
page_table_free better not add it again. Otherwise a page_table_alloc
can reuse a page table fragment that is still in the rcu process.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Martin Schwidefsky 14 жил өмнө
parent
commit
f1be77bb21

+ 2 - 1
arch/s390/mm/pgtable.c

@@ -336,7 +336,8 @@ void page_table_free(struct mm_struct *mm, unsigned long *table)
 	page->flags ^= bits;
 	page->flags ^= bits;
 	if (page->flags & FRAG_MASK) {
 	if (page->flags & FRAG_MASK) {
 		/* Page now has some free pgtable fragments. */
 		/* Page now has some free pgtable fragments. */
-		list_move(&page->lru, &mm->context.pgtable_list);
+		if (!list_empty(&page->lru))
+			list_move(&page->lru, &mm->context.pgtable_list);
 		page = NULL;
 		page = NULL;
 	} else
 	} else
 		/* All fragments of the 4K page have been freed. */
 		/* All fragments of the 4K page have been freed. */