From d0c41b230b3195728b828541987956cb8809d031 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Sat, 15 Nov 2003 00:25:58 -0800 Subject: [PATCH] Disable system call restart at sigreturn time rather than when invoking the signal. This fixes all races. As per discussion with Paul Mackerras on linux-kernel. --- arch/i386/kernel/signal.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/i386/kernel/signal.c b/arch/i386/kernel/signal.c index 0fcb9627050b2..edd844bdb0c16 100644 --- a/arch/i386/kernel/signal.c +++ b/arch/i386/kernel/signal.c @@ -132,6 +132,9 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc, int *peax { unsigned int err = 0; + /* Always make any pending restarted system calls return -EINTR */ + current_thread_info()->restart_block.fn = do_no_restart_syscall; + #define COPY(x) err |= __get_user(regs->x, &sc->x) #define COPY_SEG(seg) \ @@ -504,9 +507,6 @@ handle_signal(unsigned long sig, siginfo_t *info, sigset_t *oldset, { struct k_sigaction *ka = ¤t->sighand->action[sig-1]; - /* Always make any pending restarted system calls return -EINTR */ - current_thread_info()->restart_block.fn = do_no_restart_syscall; - /* Are we from a system call? */ if (regs->orig_eax >= 0) { /* If so, check system call restarting.. */ -- 2.53.0