lkml.org 
[lkml]   [2015]   [Nov]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH v2 1/3] signal: change sig_task_ignored(force) to take sig_kernel_only() into account
sig_task_ignored(force => true) returns false unless sig_kernel_ignore().
This makes no sense if !sig_kernel_only(), the signal will be dropped in
get_signal() anyway.

This patch simplifies the next change and allows us to do more cleanups,
in particular we can unify the SIGNAL_UNKILLABLE/sig_kernel_only() check
in sig_task_ignored() and get_signal().

The user-visible change is that, since we drop the SIG_DFL signal early,
it won't be reported to debugger. I think this is fine, but probably we
will change this later, we need to fix this logic anyway. Currently we
rely on the fact that (say) send_sigtrap() uses force_sig_info() which
clears SIGNAL_UNKILLABLE, and this is really bad.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
---
kernel/signal.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/signal.c b/kernel/signal.c
index d64efad..87209e5 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -72,7 +72,7 @@ static int sig_task_ignored(struct task_struct *t, int sig, bool force)
handler = sig_handler(t, sig);

if (unlikely(t->signal->flags & SIGNAL_UNKILLABLE) &&
- handler == SIG_DFL && !force)
+ handler == SIG_DFL && !(force && sig_kernel_only(sig)))
return 1;

return sig_handler_ignored(handler, sig);
--
1.5.5.1


\
 
 \ /
  Last update: 2015-11-05 20:41    [W:3.087 / U:0.000 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site