Commit d0c41b23 authored by Linus Torvalds's avatar Linus Torvalds

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.
parent 2aa6f74a
......@@ -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.. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment