Skip to content

Commit 053cfda

Browse files
MiaoheLintorvalds
authored andcommitted
mm/page_alloc.c: avoid accessing uninitialized pcp page migratetype
If it's not prepared to free unref page, the pcp page migratetype is unset. Thus we will get rubbish from get_pcppage_migratetype() and might list_del(&page->lru) again after it's already deleted from the list leading to grumble about data corruption. Link: https://lkml.kernel.org/r/[email protected] Fixes: df1acc8 ("mm/page_alloc: avoid conflating IRQs disabled with zone->lock") Signed-off-by: Miaohe Lin <[email protected]> Acked-by: Mel Gorman <[email protected]> Acked-by: Vlastimil Babka <[email protected]> Reviewed-by: David Hildenbrand <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 32d4f4b commit 053cfda

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

mm/page_alloc.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3428,8 +3428,10 @@ void free_unref_page_list(struct list_head *list)
34283428
/* Prepare pages for freeing */
34293429
list_for_each_entry_safe(page, next, list, lru) {
34303430
pfn = page_to_pfn(page);
3431-
if (!free_unref_page_prepare(page, pfn, 0))
3431+
if (!free_unref_page_prepare(page, pfn, 0)) {
34323432
list_del(&page->lru);
3433+
continue;
3434+
}
34333435

34343436
/*
34353437
* Free isolated pages directly to the allocator, see

0 commit comments

Comments
 (0)