summaryrefslogtreecommitdiffstats
path: root/arch/s390
diff options
context:
space:
mode:
authorVasily Gorbik <gor@linux.ibm.com>2020-06-17 15:05:49 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-07-16 08:17:22 +0200
commit7e7f71be56c563d82d0a1f9cb099c1c76a70a30d (patch)
tree992691f77f530140316a023e7352a35f67429517 /arch/s390
parent14a7ef71fbd0cc1e19da6fcd0521217712487fcf (diff)
downloadlinux-stable-7e7f71be56c563d82d0a1f9cb099c1c76a70a30d.tar.gz
linux-stable-7e7f71be56c563d82d0a1f9cb099c1c76a70a30d.tar.bz2
linux-stable-7e7f71be56c563d82d0a1f9cb099c1c76a70a30d.zip
s390/kasan: fix early pgm check handler execution
[ Upstream commit 998f5bbe3dbdab81c1cfb1aef7c3892f5d24f6c7 ] Currently if early_pgm_check_handler is called it ends up in pgm check loop. The problem is that early_pgm_check_handler is instrumented by KASAN but executed without DAT flag enabled which leads to addressing exception when KASAN checks try to access shadow memory. Fix that by executing early handlers with DAT flag on under KASAN as expected. Reported-and-tested-by: Alexander Egorenkov <egorenar@linux.ibm.com> Reviewed-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'arch/s390')
-rw-r--r--arch/s390/kernel/early.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/s390/kernel/early.c b/arch/s390/kernel/early.c
index e7e6608b996c..ad88bed74395 100644
--- a/arch/s390/kernel/early.c
+++ b/arch/s390/kernel/early.c
@@ -155,6 +155,8 @@ static noinline __init void setup_lowcore_early(void)
psw_t psw;
psw.mask = PSW_MASK_BASE | PSW_DEFAULT_KEY | PSW_MASK_EA | PSW_MASK_BA;
+ if (IS_ENABLED(CONFIG_KASAN))
+ psw.mask |= PSW_MASK_DAT;
psw.addr = (unsigned long) s390_base_ext_handler;
S390_lowcore.external_new_psw = psw;
psw.addr = (unsigned long) s390_base_pgm_handler;