Re: [PATCH 2/8] kill tracehook_notify_death()

From: Tejun Heo
Date: Mon Jun 27 2011 - 10:36:33 EST


Hello,

On Mon, Jun 27, 2011 at 04:21:36PM +0200, Oleg Nesterov wrote:
> Yes, but at the same time even __fatal_signal_pending() is too strong!
> What if the tracee exits on its own, and its sys_exit() races with
> exit_group() from another thread? In this case I think it should stop,
> but __fatal_signal_pending() is true.
>
> And worse. What if the tracee stops in PTRACE_EVENT_EXIT, and _then_
> another thread does sys_exit_group()? The tracee will be "killed".
> I do not think this is right. I think the "implicit" SIGKILL in this
> case should _not_ wake up the tracee. Only the real SIGKILL (or any
> fatal signal which mutates to SIGKILL). Otherwise we simply can't
> guarantee PTRACE_EVENT_EXIT works "reliably" in this case.

Indeed, for PTRACE_EVENT_EXIT to work properly, we would need to
discern between actual KILLs and the implicit ones.

> We have signal_group_exit()/SIGNAL_GROUP_EXIT. I think we also need
> SIGNAL_THE_REAL_SIGKILL_WAS_SENT flag. Note also we have the similar
> problems with the coredump. SIGKILL should abort it. Also, we should
> define what TIF_SIGPENDIND and interruptible wait mean after exit_signals()
> and/or exit_notify(). Some drivers (tty? I do not remember) expect that
> the exiting task can do wait_event_interruptible() and react to ^C.

Eh... that sounds very shady. Maybe we should try to remove that
weird requirement instead?

> > I don't have
> > any major problem with the original. Please go ahead.
>
> Thanks. Can I add your reviewed-by/acked-by ?

Sure, please feel free to add reviewed-by. Thanks.

--
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/