diff options
author | Matt Fleming <matt.fleming@intel.com> | 2012-05-10 20:58:05 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-05-21 23:52:32 -0400 |
commit | 80c1dfa91c44665f2cecc1666050b2e8e04cef68 (patch) | |
tree | 2240aeff22ee14cda624eb6af529ef4ab5cf1fc1 /arch/score | |
parent | 97c47bb70728c765d6cbf582759f9170fe152ded (diff) |
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.c | 14 |
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, | |||
272 | */ | 272 | */ |
273 | ret = setup_rt_frame(ka, regs, sig, oldset, info); | 273 | ret = setup_rt_frame(ka, regs, sig, oldset, info); |
274 | 274 | ||
275 | spin_lock_irq(¤t->sighand->siglock); | 275 | if (ret == 0) { |
276 | sigorsets(¤t->blocked, ¤t->blocked, &ka->sa.sa_mask); | 276 | spin_lock_irq(¤t->sighand->siglock); |
277 | if (!(ka->sa.sa_flags & SA_NODEFER)) | 277 | sigorsets(¤t->blocked, ¤t->blocked, &ka->sa.sa_mask); |
278 | sigaddset(¤t->blocked, sig); | 278 | if (!(ka->sa.sa_flags & SA_NODEFER)) |
279 | recalc_sigpending(); | 279 | sigaddset(¤t->blocked, sig); |
280 | spin_unlock_irq(¤t->sighand->siglock); | 280 | recalc_sigpending(); |
281 | spin_unlock_irq(¤t->sighand->siglock); | ||
282 | } | ||
281 | 283 | ||
282 | return ret; | 284 | return ret; |
283 | } | 285 | } |