Commit 3a83c8c8 authored by Linus Torvalds's avatar Linus Torvalds

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
parents a572582b 18451f9f
...@@ -1147,13 +1147,13 @@ void free_basic_memory_bitmaps(void) ...@@ -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) ...@@ -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 */ }
} }
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment