]> git.baikalelectronics.ru Git - kernel.git/commit
s390: fix system call exit path
authorHeiko Carstens <hca@linux.ibm.com>
Tue, 3 Nov 2020 15:55:43 +0000 (16:55 +0100)
committerHeiko Carstens <hca@linux.ibm.com>
Mon, 9 Nov 2020 10:16:11 +0000 (11:16 +0100)
commitae677b1066e0ac185468cb790a38b4e1fe543ce7
tree1ca159a0c0c1bb57c9cc205eba3694c7ab79c923
parent1a1a5d6cd1062ccc15f5dedff6e1f10224f45f11
s390: fix system call exit path

The system call exit path is running with interrupts enabled while
checking for TIF/PIF/CIF bits which require special handling. If all
bits have been checked interrupts are disabled and the kernel exits to
user space.
The problem is that after checking all bits and before interrupts are
disabled bits can be set already again, due to interrupt handling.

This means that the kernel can exit to user space with some
TIF/PIF/CIF bits set, which should never happen. E.g. TIF_NEED_RESCHED
might be set, which might lead to additional latencies, since that bit
will only be recognized with next exit to user space.

Fix this by checking the corresponding bits only when interrupts are
disabled.

Fixes: 140ddaa40243 ("s390: remove critical section cleanup from entry.S")
Cc: <stable@vger.kernel.org> # 5.8
Acked-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
arch/s390/kernel/entry.S