s390/kasan: make sure int handler always run with DAT on
authorVasily Gorbik <gor@linux.ibm.com>
Wed, 23 Sep 2020 23:01:29 +0000 (01:01 +0200)
committerVasily Gorbik <gor@linux.ibm.com>
Fri, 2 Oct 2020 12:40:48 +0000 (14:40 +0200)
commit21a66717079c3d74e8573cd48743728e4a244507
tree21020abd1377ff1b503bea8547a4a06dea7f9de5
parent5627b9224b00334e4c91122ebbb8536a9a575969
s390/kasan: make sure int handler always run with DAT on

Since commit 998f5bbe3dbd ("s390/kasan: fix early pgm check handler
execution") early pgm check handler is executed with DAT on if Kasan
is enabled.

Still there is a window between setup_lowcore_dat_off() and
setup_lowcore_dat_on() when int handlers could be executed with DAT off
under Kasan. If this happens the kernel ends up in pgm check loop due
to Kasan shadow memory access attempts.

With Kasan enabled paging is initialized much earlier and DAT flag has to
be on at all times instrumented code is executed. Make sure int handlers
are set up to be called with DAT on right away in this case.

Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
arch/s390/kernel/setup.c