[PATCH v3 0/2] mm/page_alloc: fix kernel BUG at mm/page_alloc.c:1913! crash in move_freepages()

From: Daniel Vacek
Date: Fri Mar 02 2018 - 19:12:54 EST


Kernel can crash on failed VM_BUG_ON assertion in function move_freepages()
on some rare physical memory mappings (with huge range(s) of memory
reserved by BIOS followed by usable memory not aligned to pageblock).

crash> page_init_bug -v | grep resource | sed '/RAM .3/,/RAM .4/!d'
<struct resource 0xffff88067fffd480> 4bfac000 - 646b1fff System RAM (391.02 MiB = 400408.00 KiB)
<struct resource 0xffff88067fffd4b8> 646b2000 - 793fefff reserved (333.30 MiB = 341300.00 KiB)
<struct resource 0xffff88067fffd4f0> 793ff000 - 7b3fefff ACPI Non-volatile Storage ( 32.00 MiB)
<struct resource 0xffff88067fffd528> 7b3ff000 - 7b787fff ACPI Tables ( 3.54 MiB = 3620.00 KiB)
<struct resource 0xffff88067fffd560> 7b788000 - 7b7fffff System RAM (480.00 KiB)

More details in second patch.

v2: Use -1 constant for max_pfn and remove the parameter. That's
mostly just a cosmetics.
v3: Split to two patches series to make clear what is the actual fix
and what is just a clean up. No code changes compared to v2 and
second patch is identical to original v1.

Cc: stable@xxxxxxxxxxxxxxx

Daniel Vacek (2):
mm/memblock: hardcode the max_pfn being -1
mm/page_alloc: fix memmap_init_zone pageblock alignment

mm/memblock.c | 13 ++++++-------
mm/page_alloc.c | 9 +++++++--
2 files changed, 13 insertions(+), 9 deletions(-)

--
2.16.2