s390: prevent leaking kernel address in BEAR
When userspace executes a syscall or gets interrupted,
BEAR contains a kernel address when returning to userspace.
This make it pretty easy to figure out where the kernel is
mapped even with KASLR enabled. To fix this, add lpswe to
lowcore and always execute it there, so userspace sees only
the lowcore address of lpswe. For this we have to extend
both critical_cleanup and the SWITCH_ASYNC macro to also check
for lpswe addresses in lowcore.
Fixes: b2d24b97b2a9 ("s390/kernel: add support for kernel address space layout randomization (KASLR)")
Cc: <email@example.com> # v5.2+
Reviewed-by: Gerald Schaefer <firstname.lastname@example.org>
Signed-off-by: Sven Schnelle <email@example.com>
Signed-off-by: Vasily Gorbik <firstname.lastname@example.org>
9 files changed