[PATCH v2 2/4] signal/x86: do_signal: syscall restart should be done only once.

From: NIIBE Yutaka
Date: Wed Mar 21 2018 - 21:45:36 EST


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 <gniibe@xxxxxxxx>
---
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