s390/test_unwind: fix CALL_ON_STACK tests
authorHeiko Carstens <hca@linux.ibm.com>
Sun, 13 Dec 2020 17:05:56 +0000 (18:05 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 Dec 2020 10:53:56 +0000 (11:53 +0100)
commit185640586280a76437303e668f66bffb0d112b28
tree1008ad3aaf0d6dbe822e0dcdc87bf9b1cfeb34af
parent0633094ec7ffd63f3f014e551570aaab2db4690c
s390/test_unwind: fix CALL_ON_STACK tests

[ Upstream commit f22b9c219a798e1bf11110a3d2733d883e6da059 ]

The CALL_ON_STACK tests use the no_dat stack to switch to a different
stack for unwinding tests. If an interrupt or machine check happens
while using that stack, and previously being on the async stack, the
interrupt / machine check entry code (SWITCH_ASYNC) will assume that
the previous context did not use the async stack and happily use the
async stack again.

This will lead to stack corruption of the previous context.

To solve this disable both interrupts and machine checks before
switching to the no_dat stack.

Fixes: 7868249fbbc8 ("s390/test_unwind: add CALL_ON_STACK tests")
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/s390/lib/test_unwind.c