diff options
| author | Andrew Morton <akpm@digeo.com> | 2003-06-20 08:13:33 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.transmeta.com> | 2003-06-20 08:13:33 -0700 |
| commit | b3cc42df5364fbd1bbb888f65d5aa6b1683520d9 (patch) | |
| tree | 9dada48bf8d028753ba6d3e32f40d9ac8b74c833 /kernel/fork.c | |
| parent | 237d5bd76a069b11e1098fdc62c090992f665c37 (diff) | |
[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.
Diffstat (limited to 'kernel/fork.c')
| -rw-r--r-- | kernel/fork.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/kernel/fork.c b/kernel/fork.c index fba722be316e..0fe154adc3ef 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -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 |
