Skip to content

Commit ce9dfaf

Browse files
committed
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: 0b0ed65 ("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>
1 parent f8394f2 commit ce9dfaf

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

arch/s390/kernel/entry.S

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,7 @@ ENTRY(system_call)
422422
#endif
423423
LOCKDEP_SYS_EXIT
424424
.Lsysc_tif:
425+
DISABLE_INTS
425426
TSTMSK __PT_FLAGS(%r11),_PIF_WORK
426427
jnz .Lsysc_work
427428
TSTMSK __TI_flags(%r12),_TIF_WORK
@@ -444,6 +445,7 @@ ENTRY(system_call)
444445
# One of the work bits is on. Find out which one.
445446
#
446447
.Lsysc_work:
448+
ENABLE_INTS
447449
TSTMSK __TI_flags(%r12),_TIF_NEED_RESCHED
448450
jo .Lsysc_reschedule
449451
TSTMSK __PT_FLAGS(%r11),_PIF_SYSCALL_RESTART

0 commit comments

Comments
 (0)