diff options
author | Oleg Nesterov <oleg@redhat.com> | 2009-03-02 22:58:45 +0100 |
---|---|---|
committer | Willy Tarreau <w@1wt.eu> | 2009-04-13 22:55:38 +0200 |
commit | 8d1f2ab731ab54b12f82eed4da4d1cefd238578c (patch) | |
tree | f742459a762448b5fde3951308081d7a77fbb609 | |
parent | 3551c6a671cd7aa17ef6254276000ab8f3171708 (diff) | |
download | linux-2.4-8d1f2ab731ab54b12f82eed4da4d1cefd238578c.tar.gz |
copy_process: fix CLONE_PARENT && parent_exec_id interaction
[backport of 2.6 commit 2d5516cbb9daf7d0e342a2e3b0fc6f8c39a81205]
CLONE_PARENT can fool the ->self_exec_id/parent_exec_id logic. If we
re-use the old parent, we must also re-use ->parent_exec_id to make
sure exit_notify() sees the right ->xxx_exec_id's when the CLONE_PARENT'ed
task exits.
Also, move down the "p->parent_exec_id = p->self_exec_id" thing, to place
two different cases together.
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Cc: Roland McGrath <roland@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: David Howells <dhowells@redhat.com>
Cc: Serge E. Hallyn <serge@hallyn.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Willy Tarreau <w@1wt.eu>
-rw-r--r-- | kernel/fork.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/kernel/fork.c b/kernel/fork.c index 409e49894104eb..571e53a1338093 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -767,11 +767,6 @@ int do_fork(unsigned long clone_flags, unsigned long stack_start, goto bad_fork_cleanup_namespace; p->semundo = NULL; - /* Our parent execution domain becomes current domain - These must match for thread signalling to apply */ - - p->parent_exec_id = p->self_exec_id; - /* ok, now we should be set up.. */ p->swappable = 1; p->exit_signal = clone_flags & CSIGNAL; @@ -806,6 +801,7 @@ int do_fork(unsigned long clone_flags, unsigned long stack_start, p->p_pptr = current->p_pptr; if (!(clone_flags & CLONE_PARENT)) { p->p_opptr = current; + p->parent_exec_id = p->self_exec_id; if (!(p->ptrace & PT_PTRACED)) p->p_pptr = current; } |