diff options
| author | Ingo Molnar <mingo@elte.hu> | 2002-12-14 23:48:05 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.transmeta.com> | 2002-12-14 23:48:05 -0800 |
| commit | 082220386c1b9ca3f35272ef70ece8d2988626e6 (patch) | |
| tree | 5ac2bbb6af0e3f6c7d555b5b3df44bc725e3f834 /kernel | |
| parent | ff7b2dab91fe18e79393f7a619292ecae1a4713f (diff) | |
[PATCH] ptrace-sigfix-2.5.51-A1
This fixes a threading/ptrace bug noticed by the gdb people: when a
thread is ptraced but other threads in the thread group are not then a
SIGTRAP (via int3 or any of the other debug traps) causes the child
thread(s) to die unexpectedly. This is because the default behavior for
a no-handler SIGTRAP is to broadcast it.
The solution is to make all such signals specific, then the ptracer (gdb)
can filter the signal and upon continuation it's being handled properly
(or put on the shared signal queue). SIGKILL and SIGSTOP are an exception.
The patch only affects threaded and ptrace-d processes.
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/signal.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/signal.c b/kernel/signal.c index d617fddfb60a..7c485d01a4b0 100644 --- a/kernel/signal.c +++ b/kernel/signal.c @@ -939,7 +939,8 @@ __send_sig_info(int sig, struct siginfo *info, struct task_struct *p) if (sig_ignored(p, sig)) goto out_unlock; - if (sig_kernel_specific(sig)) + if (sig_kernel_specific(sig) || + ((p->ptrace & PT_PTRACED) && !sig_kernel_only(sig))) goto out_send; /* Does any of the threads unblock the signal? */ |
