]> git.hungrycats.org Git - linux/commitdiff
Disable system call restart at sigreturn time rather than when
authorLinus Torvalds <torvalds@home.osdl.org>
Sat, 15 Nov 2003 08:25:58 +0000 (00:25 -0800)
committerLinus Torvalds <torvalds@home.osdl.org>
Sat, 15 Nov 2003 08:25:58 +0000 (00:25 -0800)
invoking the signal. This fixes all races.

As per discussion with Paul Mackerras on linux-kernel.

arch/i386/kernel/signal.c

index 0fcb9627050b287d334d2f6afb9f08a69b7e0b70..edd844bdb0c16630a04ce477f771ed6fcda65db0 100644 (file)
@@ -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 = &current->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.. */