s390/entry: add CIF_SIE flag and remove sie64a() address check
authorSven Schnelle <svens@linux.ibm.com>
Tue, 20 Feb 2024 13:21:14 +0000 (14:21 +0100)
committerHeiko Carstens <hca@linux.ibm.com>
Sun, 17 Mar 2024 18:08:49 +0000 (19:08 +0100)
commitc239c83ed5c558be3b5926c7f11639f02c8acd00
tree91765253d3ca0266bfde62f9652b58fb8ac0bd0a
parent481ec3b37678639ec1f8197c92b6e604b9549b2d
s390/entry: add CIF_SIE flag and remove sie64a() address check

When a program check, interrupt or machine check is triggered, the
PSW address is compared to a certain range of the sie64a() function
to figure out whether SIE was interrupted and a cleanup of SIE is
needed.

This doesn't work with kprobes: If kprobes probes an instruction, it
copies the instruction to the kprobes instruction page and overwrites the
original instruction with an undefind instruction (Opcode 00). When this
instruction is hit later, kprobes single-steps the instruction on the
kprobes_instruction page.

However, if this instruction is a relative branch instruction it will now
point to a different location in memory due to being moved to the kprobes
instruction page. If the new branch target points into sie64a() the kernel
assumes it interrupted SIE when processing the breakpoint and will crash
trying to access the SIE control block.

Instead of comparing the address, introduce a new CIF_SIE flag which
indicates whether SIE was interrupted.

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Suggested-by: Heiko Carstens <hca@linux.ibm.com>
Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
arch/s390/include/asm/processor.h
arch/s390/kernel/entry.S