Commit 3938b18f authored by Miles Bader's avatar Miles Bader Committed by Linus Torvalds

[PATCH] v850: signal handling race fix

Signed-off-by: default avatarMiles Bader <miles@gnu.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 18dcf5fe
...@@ -427,11 +427,9 @@ static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, ...@@ -427,11 +427,9 @@ static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
*/ */
static void static void
handle_signal(unsigned long sig, siginfo_t *info, sigset_t *oldset, handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka,
struct pt_regs * regs) sigset_t *oldset, struct pt_regs * regs)
{ {
struct k_sigaction *ka = &current->sighand->action[sig-1];
/* Are we from a system call? */ /* Are we from a system call? */
if (PT_REGS_SYSCALL (regs)) { if (PT_REGS_SYSCALL (regs)) {
/* If so, check system call restarting.. */ /* If so, check system call restarting.. */
...@@ -464,9 +462,6 @@ handle_signal(unsigned long sig, siginfo_t *info, sigset_t *oldset, ...@@ -464,9 +462,6 @@ handle_signal(unsigned long sig, siginfo_t *info, sigset_t *oldset,
else else
setup_frame(sig, ka, oldset, regs); setup_frame(sig, ka, oldset, regs);
if (ka->sa.sa_flags & SA_ONESHOT)
ka->sa.sa_handler = SIG_DFL;
if (!(ka->sa.sa_flags & SA_NODEFER)) { if (!(ka->sa.sa_flags & SA_NODEFER)) {
spin_lock_irq(&current->sighand->siglock); spin_lock_irq(&current->sighand->siglock);
sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask); sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask);
...@@ -489,6 +484,7 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset) ...@@ -489,6 +484,7 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset)
{ {
siginfo_t info; siginfo_t info;
int signr; int signr;
struct k_sigaction ka;
/* /*
* We want the common case to go fast, which * We want the common case to go fast, which
...@@ -502,10 +498,10 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset) ...@@ -502,10 +498,10 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset)
if (!oldset) if (!oldset)
oldset = &current->blocked; oldset = &current->blocked;
signr = get_signal_to_deliver(&info, regs, NULL); signr = get_signal_to_deliver(&info, &ka, regs, NULL);
if (signr > 0) { if (signr > 0) {
/* Whee! Actually deliver the signal. */ /* Whee! Actually deliver the signal. */
handle_signal(signr, &info, oldset, regs); handle_signal(signr, &info, &ka, oldset, regs);
return 1; return 1;
} }
......
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