• Vasily Gorbik's avatar
    s390/kaslr: reserve memory for kasan usage · 759d4899
    Vasily Gorbik authored
    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: default avatarGerald Schaefer <gerald.schaefer@de.ibm.com>
    Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
    759d4899
kaslr.c 4.27 KB