Commit 08222038 authored by Ingo Molnar's avatar Ingo Molnar Committed by Linus Torvalds

[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.
parent ff7b2dab
......@@ -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? */
......
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