[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20181210145716.GC4177@redhat.com>
Date: Mon, 10 Dec 2018 15:57:16 +0100
From: Oleg Nesterov <oleg@...hat.com>
To: Tycho Andersen <tycho@...ho.ws>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>,
"Eric W. Biederman" <ebiederm@...ssion.com>,
Kees Cook <keescook@...omium.org>,
Thomas Gleixner <tglx@...utronix.de>,
Linux List Kernel Mailing <linux-kernel@...r.kernel.org>
Subject: Re: 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.
Powered by blists - more mailing lists