s390/kernel: add support for kernel address space layout randomization (KASLR)
authorGerald Schaefer <gerald.schaefer@de.ibm.com>
Sun, 3 Feb 2019 20:37:20 +0000 (21:37 +0100)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Mon, 29 Apr 2019 08:47:10 +0000 (10:47 +0200)
commitb2d24b97b2a9691351920e700bfda4368c177232
treeafc715c3029b79cf1430781ffcbe39ff0656cadb
parenta80313ff91abda67641dc33bed97f6bcc5e9f6a4
s390/kernel: add support for kernel address space layout randomization (KASLR)

This patch adds support for relocating the kernel to a random address.
The random kernel offset is obtained from cpacf, using either TRNG, PRNO,
or KMC_PRNG, depending on supported MSA level.

KERNELOFFSET is added to vmcoreinfo, for crash --kaslr support.

Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Reviewed-by: Philipp Rudo <prudo@linux.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/Kconfig
arch/s390/boot/Makefile
arch/s390/boot/boot.h
arch/s390/boot/ipl_parm.c
arch/s390/boot/kaslr.c [new file with mode: 0644]
arch/s390/boot/startup.c
arch/s390/include/asm/setup.h
arch/s390/kernel/machine_kexec.c
arch/s390/kernel/setup.c