From: Oleg Nesterov On 03/07, Christoph Hellwig wrote: > > On Fri, Mar 07, 2008 at 12:58:13PM +0300, Oleg Nesterov wrote: > > Note that we don't return an error if lock_task_sighand() fails, we pretend the > > task dies after receiving the signal. Otherwise, we should fight with the nasty > > races with mt-exec without having any advantage. > > This should be mentioned in a comment in the code. Signed-off-by: Oleg Nesterov Cc: Roland McGrath Cc: Christoph Hellwig Signed-off-by: Andrew Morton --- kernel/signal.c | 4 ++++ 1 file changed, 4 insertions(+) diff -puN kernel/signal.c~signals-do_tkill-dont-use-tasklist_lock-comment kernel/signal.c --- a/kernel/signal.c~signals-do_tkill-dont-use-tasklist_lock-comment +++ a/kernel/signal.c @@ -2222,6 +2222,10 @@ static int do_tkill(int tgid, int pid, i /* * The null signal is a permissions and process existence * probe. No signal is actually delivered. + * + * If lock_task_sighand() fails we pretend the task dies + * after receiving the signal. The window is tiny, and the + * signal is private anyway. */ if (!error && sig && lock_task_sighand(p, &flags)) { error = specific_send_sig_info(sig, &info, p); _