[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 1 Feb 2011 16:27:29 -0800
From: Andrew Morton <akpm@...ux-foundation.org>
To: Tejun Heo <tj@...nel.org>
Cc: Roland McGrath <roland@...hat.com>, oleg@...hat.com,
jan.kratochvil@...hat.com, linux-kernel@...r.kernel.org,
torvalds@...ux-foundation.org
Subject: Re: [PATCH] ptrace: use safer wake up on ptrace_detach()
On Tue, 1 Feb 2011 11:26:18 +0100
Tejun Heo <tj@...nel.org> wrote:
> The wake_up_process() call in ptrace_detach() is spurious and not
> interlocked with the tracee state. IOW, the tracee could be running
> or sleeping in any place in the kernel by the time wake_up_process()
> is called. This can lead to the tracee waking up unexpectedly which
> can be dangerous.
>
> The wake_up is spurious and should be removed but for now reduce its
> toxicity by only waking up if the tracee is in TRACED or STOPPED
> state.
>
> Signed-off-by: Tejun Heo <tj@...nel.org>
> Cc: Roland McGrath <roland@...hat.com>
> Cc: Oleg Nesterov <oleg@...hat.com>
> Cc: stable@...nel.org
Am unable to work out why you tagged it for backporting. It fixes some
observed bug? Perhaps a regression?
> Index: work/kernel/ptrace.c
> ===================================================================
> --- work.orig/kernel/ptrace.c
> +++ work/kernel/ptrace.c
> @@ -313,7 +313,7 @@ int ptrace_detach(struct task_struct *ch
> child->exit_code = data;
> dead = __ptrace_detach(current, child);
> if (!child->exit_state)
> - wake_up_process(child);
> + wake_up_state(child, TASK_TRACED | TASK_STOPPED);
> }
> write_unlock_irq(&tasklist_lock);
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists