Commit 580d34e4 authored by Oleg Nesterov's avatar Oleg Nesterov Committed by Linus Torvalds
Browse files

signals: disallow_signal() should flush the potentially pending signal

disallow_signal() simply sets SIG_IGN, this is not enough and
recalc_sigpending() is simply pointless because in can never change the

If we ignore a signal, we also need to do flush_sigqueue_mask() for the
case when this signal is pending, this way recalc_sigpending() can
actually clear TIF_SIGPENDING and we do not "leak" the allocated
Signed-off-by: default avatarOleg Nesterov <>
Cc: Peter Zijlstra <>
Cc: Al Viro <>
Cc: David Woodhouse <>
Cc: Frederic Weisbecker <>
Cc: Geert Uytterhoeven <>
Cc: Ingo Molnar <>
Cc: Mathieu Desnoyers <>
Cc: Richard Weinberger <>
Cc: Steven Rostedt <>
Cc: Tejun Heo <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent ec5955b8
......@@ -3085,8 +3085,15 @@ EXPORT_SYMBOL(allow_signal);
void disallow_signal(int sig)
sigset_t mask;
sigaddset(&mask, sig);
current->sighand->action[(sig)-1].sa.sa_handler = SIG_IGN;
flush_sigqueue_mask(&mask, &current->signal->shared_pending);
flush_sigqueue_mask(&mask, &current->pending);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment