summaryrefslogtreecommitdiff
path: root/kernel/fork.c
diff options
context:
space:
mode:
authorAndrew Morton <akpm@digeo.com>2003-06-20 08:13:33 -0700
committerLinus Torvalds <torvalds@home.transmeta.com>2003-06-20 08:13:33 -0700
commitb3cc42df5364fbd1bbb888f65d5aa6b1683520d9 (patch)
tree9dada48bf8d028753ba6d3e32f40d9ac8b74c833 /kernel/fork.c
parent237d5bd76a069b11e1098fdc62c090992f665c37 (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.c6
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