Merge tag 'pm-5.5-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull power management fix from Rafael Wysocki: "Prevent the kernel from crashing during resume from hibernation if free pages contain leftover data from the restore kernel and init_on_free is set (Alexander Potapenko)" * tag 'pm-5.5-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: PM: hibernate: fix crashes with init_on_free=1
This commit is contained in:
@ -1147,13 +1147,13 @@ void free_basic_memory_bitmaps(void)
|
|||||||
|
|
||||||
void clear_free_pages(void)
|
void clear_free_pages(void)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_PAGE_POISONING_ZERO
|
|
||||||
struct memory_bitmap *bm = free_pages_map;
|
struct memory_bitmap *bm = free_pages_map;
|
||||||
unsigned long pfn;
|
unsigned long pfn;
|
||||||
|
|
||||||
if (WARN_ON(!(free_pages_map)))
|
if (WARN_ON(!(free_pages_map)))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (IS_ENABLED(CONFIG_PAGE_POISONING_ZERO) || want_init_on_free()) {
|
||||||
memory_bm_position_reset(bm);
|
memory_bm_position_reset(bm);
|
||||||
pfn = memory_bm_next_pfn(bm);
|
pfn = memory_bm_next_pfn(bm);
|
||||||
while (pfn != BM_END_OF_MAP) {
|
while (pfn != BM_END_OF_MAP) {
|
||||||
@ -1164,7 +1164,7 @@ void clear_free_pages(void)
|
|||||||
}
|
}
|
||||||
memory_bm_position_reset(bm);
|
memory_bm_position_reset(bm);
|
||||||
pr_info("free pages cleared after restore\n");
|
pr_info("free pages cleared after restore\n");
|
||||||
#endif /* PAGE_POISONING_ZERO */
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user