]> git.baikalelectronics.ru Git - kernel.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)
commitd2337a64f34634cb13cdf0b9f419927b0329ec41
tree24a348f45afcab6e90b02c6c42f6482562a7dd3f
parentc1ebbae373a71a8f8f3fd4f52581699ba14a2893
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