Skip to content

Commit 9c732cc

Browse files
Vasily Gorbikgregkh
authored andcommitted
s390/kasan: fix early pgm check handler execution
[ Upstream commit 998f5bb ] 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>
1 parent a9c8164 commit 9c732cc

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

arch/s390/kernel/early.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,8 @@ static noinline __init void setup_lowcore_early(void)
169169
psw_t psw;
170170

171171
psw.mask = PSW_MASK_BASE | PSW_DEFAULT_KEY | PSW_MASK_EA | PSW_MASK_BA;
172+
if (IS_ENABLED(CONFIG_KASAN))
173+
psw.mask |= PSW_MASK_DAT;
172174
psw.addr = (unsigned long) s390_base_ext_handler;
173175
S390_lowcore.external_new_psw = psw;
174176
psw.addr = (unsigned long) s390_base_pgm_handler;

0 commit comments

Comments
 (0)