lkml.org 
[lkml]   [2018]   [Dec]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: siginfo pid not populated from ptrace?
On 12/06, Tycho Andersen wrote:
>
> --- a/kernel/signal.c
> +++ b/kernel/signal.c
> @@ -1056,11 +1056,14 @@ static int __send_signal(int sig, struct kernel_siginfo *info, struct task_struc
> goto ret;
>
> result = TRACE_SIGNAL_DELIVERED;
> +
> /*
> - * Skip useless siginfo allocation for SIGKILL SIGSTOP,
> - * and kernel threads.
> + * Skip useless siginfo allocation for SIGKILL and kernel threads.
> + * SIGSTOP is visible to tracers, so only skip allocation when the task
> + * is not traced.
> */
> - if (sig_kernel_only(sig) || (t->flags & PF_KTHREAD))
> + if ((sig == SIGKILL) || (!task_is_traced(t) && sig == SIGSTOP) ||
^^^^^^^^^^^^^^

task_is_traced() checks task->state, probably you meant t->ptrace != 0.

However, in multithreaded case t->ptrace won't help too, unless the signal
is private you do not know which thread will actually dequeue this signal
and possibly report to debugger.

Oleg.

\
 
 \ /
  Last update: 2018-12-10 15:58    [W:0.125 / U:1.924 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site