From: Matt Fleming Date: Fri, 11 May 2012 00:58:05 +0000 (+1000) Subject: score: don't mask signals if we fail to setup signal stack X-Git-Tag: v5.15~22401^2~48 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=80c1dfa91c44665f2cecc1666050b2e8e04cef68;p=mirror_ubuntu-kernels.git 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 Cc: Chen Liqin Cc: Lennox Wu Signed-off-by: Matt Fleming Signed-off-by: Andrew Morton Signed-off-by: Al Viro --- 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(¤t->sighand->siglock); - sigorsets(¤t->blocked, ¤t->blocked, &ka->sa.sa_mask); - if (!(ka->sa.sa_flags & SA_NODEFER)) - sigaddset(¤t->blocked, sig); - recalc_sigpending(); - spin_unlock_irq(¤t->sighand->siglock); + if (ret == 0) { + spin_lock_irq(¤t->sighand->siglock); + sigorsets(¤t->blocked, ¤t->blocked, &ka->sa.sa_mask); + if (!(ka->sa.sa_flags & SA_NODEFER)) + sigaddset(¤t->blocked, sig); + recalc_sigpending(); + spin_unlock_irq(¤t->sighand->siglock); + } return ret; }