* [RFC PATCH 00/12 v3] ptrace: introduce task_struct->ptrace_cxt
@ 2009-05-30 22:38 Oleg Nesterov
2009-06-01 0:38 ` Roland McGrath
0 siblings, 1 reply; 2+ messages in thread
From: Oleg Nesterov @ 2009-05-30 22:38 UTC (permalink / raw)
To: Roland McGrath; +Cc: Christoph Hellwig, Ingo Molnar, linux-kernel
Changes:
04/12: move kfree() outside of task_lock() in alloc_ptrace_context().
But I misread your sugesstion:
> task_lock(tsk);
> if (likely(!tsk->ptrace_ctx)) {
> tsk->ptrace_ctx = ptrace_ctx;
> task_unlock(tsk);
> return 0;
> }
>
> task_unlock(tsk);
> kfree(ptrace_ctx);
Just can't do that. I hate multiple unlocks very much. So it
becomes:
task_lock(tsk);
if (likely(!tsk->ptrace_ctx)) {
tsk->ptrace_ctx = ptrace_ctx;
ptrace_ctx = NULL;
}
task_unlock(tsk);
kfree(ptrace_ctx);
kfree(NULL) is specially allowed.
05/12: Add the comment about tracehook_init_task to ptrace_init_task().
I didn't change the original comment, but imho it is confusing.
"immediately after adding @child to its parent's children list"
does not matter. What does matter, is that it is called before
this child is visible to the user-space and thus the unconditional
ptrace_link() is safe: nobody could attach before us.
08/12: No changes, but I think it better to change format_mca_init_stack()
right now. Imho it has nothing to do with tracehooks and it is the
last user of ->parent (except perhaps there are some in arch/ code
which should be tracehookfied).
09/12: Remove the stale "pt_" from the changelog.
Oleg.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-06-01 0:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-30 22:38 [RFC PATCH 00/12 v3] ptrace: introduce task_struct->ptrace_cxt Oleg Nesterov
2009-06-01 0:38 ` Roland McGrath
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox