From: Oleg Nesterov do_sigaction() returns -ERESTARTNOINTR if signal_pending(). The comment says: * If there might be a fatal signal pending on multiple * threads, make sure we take it before changing the action. I think this is not needed. We should only worry about SIGNAL_GROUP_EXIT case, bit it implies a pending SIGKILL which can't be cleared by do_sigaction. Kill this special case. Signed-off-by: Oleg Nesterov Acked-by: Roland McGrath Signed-off-by: Andrew Morton --- kernel/signal.c | 9 --------- 1 files changed, 9 deletions(-) diff -puN kernel/signal.c~do_sigaction-dont-worry-about-signal_pending kernel/signal.c --- a/kernel/signal.c~do_sigaction-dont-worry-about-signal_pending +++ a/kernel/signal.c @@ -2296,15 +2296,6 @@ int do_sigaction(int sig, struct k_sigac k = ¤t->sighand->action[sig-1]; spin_lock_irq(¤t->sighand->siglock); - if (signal_pending(current)) { - /* - * If there might be a fatal signal pending on multiple - * threads, make sure we take it before changing the action. - */ - spin_unlock_irq(¤t->sighand->siglock); - return -ERESTARTNOINTR; - } - if (oact) *oact = *k; _