This is a note to let you know that I've just added the patch titled s390: fix system call exit path to the 5.9-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: s390-fix-system-call-exit-path.patch and it can be found in the queue-5.9 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From ce9dfafe29bed86fe3cda330ac6072ce84e1ff81 Mon Sep 17 00:00:00 2001 From: Heiko Carstens <hca@xxxxxxxxxxxxx> Date: Tue, 3 Nov 2020 16:55:43 +0100 Subject: s390: fix system call exit path From: Heiko Carstens <hca@xxxxxxxxxxxxx> commit ce9dfafe29bed86fe3cda330ac6072ce84e1ff81 upstream. 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: 0b0ed657fe00 ("s390: remove critical section cleanup from entry.S") Cc: <stable@xxxxxxxxxxxxxxx> # 5.8 Acked-by: Sven Schnelle <svens@xxxxxxxxxxxxx> Signed-off-by: Heiko Carstens <hca@xxxxxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- arch/s390/kernel/entry.S | 2 ++ 1 file changed, 2 insertions(+) --- a/arch/s390/kernel/entry.S +++ b/arch/s390/kernel/entry.S @@ -422,6 +422,7 @@ ENTRY(system_call) #endif LOCKDEP_SYS_EXIT .Lsysc_tif: + DISABLE_INTS TSTMSK __PT_FLAGS(%r11),_PIF_WORK jnz .Lsysc_work TSTMSK __TI_flags(%r12),_TIF_WORK @@ -446,6 +447,7 @@ ENTRY(system_call) # One of the work bits is on. Find out which one. # .Lsysc_work: + ENABLE_INTS TSTMSK __TI_flags(%r12),_TIF_NEED_RESCHED jo .Lsysc_reschedule TSTMSK __PT_FLAGS(%r11),_PIF_SYSCALL_RESTART Patches currently in stable-queue which might be from hca@xxxxxxxxxxxxx are queue-5.9/s390-cpum_sf.c-fix-file-permission-for-cpum_sfb_size.patch queue-5.9/s390-fix-system-call-exit-path.patch queue-5.9/mm-userfaultfd-do-not-access-vma-vm_mm-after-calling-handle_userfault.patch