summaryrefslogtreecommitdiffstats
path: root/arch/score
diff options
context:
space:
mode:
authorMatt Fleming <matt.fleming@intel.com>2012-05-11 02:58:05 +0200
committerAl Viro <viro@zeniv.linux.org.uk>2012-05-22 05:52:32 +0200
commit80c1dfa91c44665f2cecc1666050b2e8e04cef68 (patch)
tree2240aeff22ee14cda624eb6af529ef4ab5cf1fc1 /arch/score
parenth8300: use set_current_blocked() and block_sigmask() (diff)
downloadlinux-80c1dfa91c44665f2cecc1666050b2e8e04cef68.tar.xz
linux-80c1dfa91c44665f2cecc1666050b2e8e04cef68.zip
score: don't mask signals if we fail to setup signal stack
If setup_rt_frame() returns -EFAULT then we must not block any signals in the current process. Acked-by: Oleg Nesterov <oleg@redhat.com> Cc: Chen Liqin <liqin.chen@sunplusct.com> Cc: Lennox Wu <lennox.wu@gmail.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch/score')
-rw-r--r--arch/score/kernel/signal.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/arch/score/kernel/signal.c b/arch/score/kernel/signal.c
index aa57440e4973..bf9e33e05334 100644
--- a/arch/score/kernel/signal.c
+++ b/arch/score/kernel/signal.c
@@ -272,12 +272,14 @@ static int handle_signal(unsigned long sig, siginfo_t *info,
*/
ret = setup_rt_frame(ka, regs, sig, oldset, info);
- spin_lock_irq(&current->sighand->siglock);
- sigorsets(&current->blocked, &current->blocked, &ka->sa.sa_mask);
- if (!(ka->sa.sa_flags & SA_NODEFER))
- sigaddset(&current->blocked, sig);
- recalc_sigpending();
- spin_unlock_irq(&current->sighand->siglock);
+ if (ret == 0) {
+ spin_lock_irq(&current->sighand->siglock);
+ sigorsets(&current->blocked, &current->blocked, &ka->sa.sa_mask);
+ if (!(ka->sa.sa_flags & SA_NODEFER))
+ sigaddset(&current->blocked, sig);
+ recalc_sigpending();
+ spin_unlock_irq(&current->sighand->siglock);
+ }
return ret;
}