Ard Biesheuvel b9bc36704c ARM, xtensa: highmem: avoid clobbering non-page aligned memory reservations
free_highpages() iterates over the free memblock regions in high
memory, and marks each page as available for the memory management
system.

Until commit cddb5ddf2b76 ("arm, xtensa: simplify initialization of
high memory pages") it rounded beginning of each region upwards and end of
each region downwards.

However, after that commit free_highmem() rounds the beginning and end of
each region downwards, and we may end up freeing a page that is
memblock_reserve()d, resulting in memory corruption.

Restore the original rounding of the region boundaries to avoid freeing
reserved pages.

Fixes: cddb5ddf2b76 ("arm, xtensa: simplify initialization of high memory pages")
Link: https://lore.kernel.org/r/20201029110334.4118-1-ardb@kernel.org/
Link: https://lore.kernel.org/r/20201031094345.6984-1-rppt@kernel.org
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Co-developed-by:  Mike Rapoport <rppt@linux.ibm.com>
Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
Acked-by: Max Filippov <jcmvbkbc@gmail.com>
2020-11-04 10:42:57 +02:00
..
2020-10-28 17:09:56 +01:00
2020-10-24 10:33:08 -07:00
2020-10-24 10:33:08 -07:00
2020-10-03 12:47:56 -07:00
2020-10-26 10:11:55 +01:00
2020-10-24 10:33:08 -07:00
2020-10-24 10:33:08 -07:00
2020-05-15 23:04:40 +02:00
2020-10-24 10:33:08 -07:00
2020-10-24 10:33:08 -07:00
2020-05-15 23:04:40 +02:00
2020-10-15 14:43:29 -07:00
2020-07-21 16:33:35 +01:00
2020-10-24 10:33:08 -07:00
2020-10-24 10:33:08 -07:00
2020-10-24 10:33:08 -07:00