Skip to content

Commit fc66127

Browse files
svens-s390Vasily Gorbik
authored andcommitted
s390: fix system call restart with multiple signals
glibc complained with "The futex facility returned an unexpected error code.". It turned out that the futex syscall returned -ERESTARTSYS because a signal is pending. arch_do_signal_or_restart() restored the syscall parameters (nameley regs->gprs[2]) and set PIF_SYSCALL_RESTART. When another signal is made pending later in the exit loop arch_do_signal_or_restart() is called again. This function clears PIF_SYSCALL_RESTART and checks the return code which is set in regs->gprs[2]. However, regs->gprs[2] was restored in the previous run and no longer contains -ERESTARTSYS, so PIF_SYSCALL_RESTART isn't set again and the syscall is skipped. Fix this by not clearing PIF_SYSCALL_RESTART - it is already cleared in __do_syscall() when the syscall is restarted. Reported-by: Bjoern Walk <[email protected]> Signed-off-by: Sven Schnelle <[email protected]> Reviewed-by: Heiko Carstens <[email protected]> Fixes: 56e62a7 ("s390: convert to generic entry") Cc: <[email protected]> # 5.12 Signed-off-by: Vasily Gorbik <[email protected]>
1 parent 13311e7 commit fc66127

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

arch/s390/kernel/signal.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,6 @@ void arch_do_signal_or_restart(struct pt_regs *regs, bool has_signal)
512512

513513
/* No handlers present - check for system call restart */
514514
clear_pt_regs_flag(regs, PIF_SYSCALL);
515-
clear_pt_regs_flag(regs, PIF_SYSCALL_RESTART);
516515
if (current->thread.system_call) {
517516
regs->int_code = current->thread.system_call;
518517
switch (regs->gprs[2]) {

0 commit comments

Comments
 (0)