
From: Andrew Morton <akpm@osdl.org>

Cc: Guillaume Thouvenin <guillaume.thouvenin@bull.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 kernel/fork.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff -puN kernel/fork.c~connector-add-a-fork-connector-use-after-free-fix kernel/fork.c
--- devel/kernel/fork.c~connector-add-a-fork-connector-use-after-free-fix	2005-07-26 00:38:28.000000000 -0700
+++ devel-akpm/kernel/fork.c	2005-07-26 00:38:28.000000000 -0700
@@ -1263,14 +1263,15 @@ long do_fork(unsigned long clone_flags,
 			ptrace_notify ((trace << 8) | SIGTRAP);
 		}
 
+		fork_connector(current->tgid, current->pid, p->tgid, p->pid);
+
 		if (clone_flags & CLONE_VFORK) {
+
 			wait_for_completion(&vfork);
 			if (unlikely (current->ptrace & PT_TRACE_VFORK_DONE))
-				ptrace_notify ((PTRACE_EVENT_VFORK_DONE << 8) | SIGTRAP);
+				ptrace_notify((PTRACE_EVENT_VFORK_DONE << 8) |
+						SIGTRAP);
 		}
-
-		fork_connector(current->tgid, current->pid,
-		               p->tgid, p->pid);
 	} else {
 		numtasks_put_ref(&current->taskclass->core);
 		free_pidmap(pid);
_
