Commit b3cc42df authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] Fix potential set_child_tid/clear_child_tid bug

From: David Mosberger <davidm@napali.hpl.hp.com>

At the moment, if you don't set CLONE_CHILD_SETTID/CLONE_CHILD_CLEARTID,
the {set,clear}_child_tid values get inherited from the parent task.  I may
be missing something, but I suspect that's not the intended behavior.  The
patch below instead clears the respective members.
parent 237d5bd7
......@@ -887,13 +887,11 @@ struct task_struct *copy_process(unsigned long clone_flags,
if (retval)
goto bad_fork_cleanup_namespace;
if (clone_flags & CLONE_CHILD_SETTID)
p->set_child_tid = child_tidptr;
p->set_child_tid = (clone_flags & CLONE_CHILD_SETTID) ? child_tidptr : NULL;
/*
* Clear TID on mm_release()?
*/
if (clone_flags & CLONE_CHILD_CLEARTID)
p->clear_child_tid = child_tidptr;
p->clear_child_tid = (clone_flags & CLONE_CHILD_CLEARTID) ? child_tidptr: NULL;
/*
* Syscall tracing should be turned off in the child regardless
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment