Re: [patch 3/14] x86, ptrace, bts: stop bts tracing early in do_exit

From: Andi Kleen
Date: Mon Mar 30 2009 - 06:44:37 EST




ds_release_bts(struct bts_tracer *tracer)
{
struct task_struct *task =
tracer->ds.context->task;

do {
set_task_state(task, TASK_UNINTERRUPTIBLE);
Oh, this is not right,

Agreed.

I wonder if it is ever safe to change another task's state.
There's a lot of code that sets the task state seemingly
unprotected - but always for current.

It should be safe when you can guarantee that the other task is stopped
(as in ptrace) and you protect against yourself (only a single
external writer)

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