]> asedeno.scripts.mit.edu Git - linux.git/commit
s390/kaslr: reserve memory for kasan usage
authorVasily Gorbik <gor@linux.ibm.com>
Mon, 19 Aug 2019 21:19:00 +0000 (23:19 +0200)
committerVasily Gorbik <gor@linux.ibm.com>
Mon, 26 Aug 2019 10:51:18 +0000 (12:51 +0200)
commit759d4899d905c2a491d34987366421aebca359de
tree24a348f45afcab6e90b02c6c42f6482562a7dd3f
parent9b692102d87d13d24c97461207cae259121ed44b
s390/kaslr: reserve memory for kasan usage

Sometimes the kernel fails to boot with:
"The Linux kernel failed to boot with the KernelAddressSanitizer:
out of memory during initialisation" even with big amounts of memory when
both kaslr and kasan are enabled.

The problem is that kasan initialization code requires 1/8 of physical
memory plus some for page tables. To keep as much code instrumented
as possible kasan avoids using memblock for memory allocations. Instead
kasan uses trivial memory allocator which simply chops off the memory
from the end of online physical memory. For that reason when kaslr is
enabled together with kasan avoid positioning kernel into upper memory
region which would be utilized during kasan initialization.

Reviewed-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
arch/s390/boot/kaslr.c