[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20090507003159.73DE8FC39E@magilla.sf.frob.com>
Date: Wed, 6 May 2009 17:31:59 -0700 (PDT)
From: Roland McGrath <roland@...hat.com>
To: Oleg Nesterov <oleg@...hat.com>
Cc: Ingo Molnar <mingo@...e.hu>,
Andrew Morton <akpm@...ux-foundation.org>,
Chris Wright <chrisw@...s-sol.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/3] ptrace: cleanup check/set of PT_PTRACED during
attach
> The only case when a task owns (iow, can change it safely) its ->ptrace
> is: it is running _and_ traced. I think this is what the comment tried
> to say.
I think so. I suspect it only ever referred to now-obsolete uses like
PT_DTRACE fiddling.
> But this doesn't really matter, because afaics the correct comment
> should say: the task should never touch its ->ptrace, ptracer always
> owns it.
To be clear, it should say something about how two potential ptracers
exclude each other touching it.
> There is only one exception afaics, de_thread() or do_wait() can call
> release_task()->ptrace_unlink() and clear ->ptrace on behalve of
> another (not ptracer) task.
And ptrace_traceme(). Both of these I'd call "on behalf of the tracer",
and that is close enough to "tracer owns it" if their rules are explained.
(That in contrast to the old comment's suggestion that the tracee could
touch its own unlocked.)
Thanks,
Roland
--
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