Re: [PATCH] OOM killer: wait for tasks with pending SIGKILL to exit

From: Oleg Nesterov
Date: Mon Sep 09 2013 - 12:37:31 EST


Can't really comment this patch, just one off-topic note...

On 09/09, Sergey Dyasly wrote:
>
> @@ -275,13 +275,16 @@ enum oom_scan_t oom_scan_process_thread(struct task_struct *task,
> if (oom_task_origin(task))
> return OOM_SCAN_SELECT;
>
> - if (task->flags & PF_EXITING && !force_kill) {
> + if ((task->flags & PF_EXITING || fatal_signal_pending(task)) &&
> + !force_kill) {
> /*
> * If this task is not being ptraced on exit, then wait for it
> * to finish before killing some other task unnecessarily.
> */
> - if (!(task->group_leader->ptrace & PT_TRACE_EXIT))
> + if (!(task->group_leader->ptrace & PT_TRACE_EXIT)) {

can't we finally kill (or fix?) this PT_TRACE_EXIT check?

It was added to fix the exploit I sent. But the patch was wrong,
that exploit could be easily modified to trigger the same problem.

However, now that the coredumping is killable that exploit won't
work, so the original reason has gone away.

So why do we need this check today?

And note that we check ->group_leader, this looks completely wrong.
(again, ->group_leader was used just because the original exploit
traced the group leader).

David?

Oleg.

--
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/