do_signal may be called multiple times from exit_to_usermode_loop. In those multiple calls, only the one should handle restarting the system call.
When actually delivering a signal, make sure the register will not be examined again as syscall errno by another call of do_signal. Signed-off-by: NIIBE Yutaka <gni...@fsij.org> --- arch/x86/kernel/signal.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/kernel/signal.c b/arch/x86/kernel/signal.c index cdfb82031243..e709b54a01b8 100644 --- a/arch/x86/kernel/signal.c +++ b/arch/x86/kernel/signal.c @@ -729,6 +729,7 @@ handle_signal(struct ksignal *ksig, struct pt_regs *regs) regs->ip -= 2; break; } + regs->orig_ax = -1; } /* -- 2.11.0