Commit 22a33c7e authored by Vasily Gorbik's avatar Vasily Gorbik

s390/startup: round down "mem" option to page boundary

Make a usable value out of "mem" option once and for all. Kasan memory
allocator just takes memory_end or online memory size as allocation
base. If memory_end is not aligned paging structures allocated in kasan
end up unaligned as well. So this change fixes potential kasan crash
as well.

Fixes: 78333d1f ("s390/kasan: add support for mem= kernel parameter")
Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
parent 80ef517b
......@@ -224,7 +224,7 @@ void parse_boot_command_line(void)
args = next_arg(args, &param, &val);
if (!strcmp(param, "mem")) {
memory_end = memparse(val, NULL);
memory_end = round_down(memparse(val, NULL), PAGE_SIZE);
memory_end_set = 1;
}
......
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