Skip to content

Commit

Permalink
[MIPS] Avoid double signal restarting.
Browse files Browse the repository at this point in the history
In entry.S resume_userspace ... jal do_notify_resume form a loop through
which the kernel will iterate as long as work is pending.  If we
iterate through this loop more than once with no signal pending for at
least one but the last iteration we will take do the syscall restarting
multiple times resulting in a syscall return prior to the the syscall
instruction in userspace.  This may happen when debugging a multithreaded
program.

Debugging and original fix by Maciej; extended to other ABIs by me.

Signed-off-by: Maciej W. Rozycki <macro@mips.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
  • Loading branch information
Ralf Baechle committed Sep 27, 2006
1 parent 847b9df commit 13fdd31
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions arch/mips/kernel/irixsig.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ void do_irix_signal(struct pt_regs *regs)
regs->regs[7] = regs->regs[26];
regs->cp0_epc -= 4;
}
regs->regs[0] = 0; /* Don't deal with this again. */
}

/*
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/kernel/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,6 @@ void do_signal(struct pt_regs *regs)
else
oldset = &current->blocked;


signr = get_signal_to_deliver(&info, &ka, regs, NULL);
if (signr > 0) {
/* Whee! Actually deliver the signal. */
Expand Down Expand Up @@ -464,6 +463,7 @@ void do_signal(struct pt_regs *regs)
regs->regs[7] = regs->regs[26];
regs->cp0_epc -= 4;
}
regs->regs[0] = 0; /* Don't deal with this again. */
}

/*
Expand Down
1 change: 1 addition & 0 deletions arch/mips/kernel/signal32.c
Original file line number Diff line number Diff line change
Expand Up @@ -854,6 +854,7 @@ void do_signal32(struct pt_regs *regs)
regs->regs[7] = regs->regs[26];
regs->cp0_epc -= 4;
}
regs->regs[0] = 0; /* Don't deal with this again. */
}

/*
Expand Down

0 comments on commit 13fdd31

Please sign in to comment.