diff options
author | Matt Fleming <matt.fleming@intel.com> | 2012-05-10 20:57:57 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-05-21 23:52:36 -0400 |
commit | e1b1fd79a04396d5ec971e9e4d4711b5a58ad7e3 (patch) | |
tree | 24e80e0321f62439950fb11357f44cf46eafc4e8 /arch/avr32/kernel | |
parent | 3883e301bf05457d09ffc16c03ead6182ac3d732 (diff) |
avr32: don't mask signals in the error path
The current handle_signal() implementation is broken - it will mask
signals if we fail to setup the signal stack frame, which isn't the
desired behaviour, we should only be masking signals if we succeed in
setting up the stack frame. It looks like this code was copied from the
old (broken) arm implementation but wasn't updated when the arm code was
fixed in commit a6c61e9dfdd0 ("[ARM] 3168/1: Update ARM signal delivery
and masking").
Cc: Hans-Christian Egtvedt <egtvedt@samfundet.no>
Acked-by: Havard Skinnemoen <hskinnemoen@gmail.com>
Acked-by: Oleg Nesterov <oleg@redhat.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/avr32/kernel')
-rw-r--r-- | arch/avr32/kernel/signal.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/arch/avr32/kernel/signal.c b/arch/avr32/kernel/signal.c index 64f886fac2ef..9c075e105d60 100644 --- a/arch/avr32/kernel/signal.c +++ b/arch/avr32/kernel/signal.c | |||
@@ -238,22 +238,21 @@ handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info, | |||
238 | */ | 238 | */ |
239 | ret |= !valid_user_regs(regs); | 239 | ret |= !valid_user_regs(regs); |
240 | 240 | ||
241 | if (ret != 0) { | ||
242 | force_sigsegv(sig, current); | ||
243 | return; | ||
244 | } | ||
245 | |||
241 | /* | 246 | /* |
242 | * Block the signal if we were unsuccessful. | 247 | * Block the signal if we were successful. |
243 | */ | 248 | */ |
244 | if (ret != 0 || !(ka->sa.sa_flags & SA_NODEFER)) { | 249 | spin_lock_irq(¤t->sighand->siglock); |
245 | spin_lock_irq(¤t->sighand->siglock); | 250 | sigorsets(¤t->blocked, ¤t->blocked, |
246 | sigorsets(¤t->blocked, ¤t->blocked, | 251 | &ka->sa.sa_mask); |
247 | &ka->sa.sa_mask); | 252 | if (!(ka->sa.sa_flags & SA_NODEFER)) |
248 | sigaddset(¤t->blocked, sig); | 253 | sigaddset(¤t->blocked, sig); |
249 | recalc_sigpending(); | 254 | recalc_sigpending(); |
250 | spin_unlock_irq(¤t->sighand->siglock); | 255 | spin_unlock_irq(¤t->sighand->siglock); |
251 | } | ||
252 | |||
253 | if (ret == 0) | ||
254 | return; | ||
255 | |||
256 | force_sigsegv(sig, current); | ||
257 | } | 256 | } |
258 | 257 | ||
259 | /* | 258 | /* |