summaryrefslogtreecommitdiff
path: root/sys/compat/linux/common/linux_exec.c
diff options
context:
space:
mode:
authornjoly <njoly@NetBSD.org>2008-04-11 16:47:50 +0000
committernjoly <njoly@NetBSD.org>2008-04-11 16:47:50 +0000
commit26457ccc1d4741df0f9ccf1ad9bf358d82b11a2e (patch)
tree62ac9bd897d49f5277d6df56767cfb93a9a2ee7b /sys/compat/linux/common/linux_exec.c
parent9a6b7a1ccd5f9502b185b70fa97ea59fd9d9b71b (diff)
Under NPTL emulation, do not reparent all members of a thread group,
but only the processes that emulate threads (with LINUX_CLONE_THREAD set). This fix a problem for child processes that share address space with the parent. At exit, the child will die silently, leaving the parent waiting indefinitely for its end ...
Diffstat (limited to 'sys/compat/linux/common/linux_exec.c')
-rw-r--r--sys/compat/linux/common/linux_exec.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/compat/linux/common/linux_exec.c b/sys/compat/linux/common/linux_exec.c
index e5cc6d013b5..637f4756415 100644
--- a/sys/compat/linux/common/linux_exec.c
+++ b/sys/compat/linux/common/linux_exec.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_exec.c,v 1.101 2008/04/08 20:25:00 njoly Exp $ */
+/* $NetBSD: linux_exec.c,v 1.102 2008/04/11 16:47:50 njoly Exp $ */
/*-
* Copyright (c) 1994, 1995, 1998, 2000, 2007 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_exec.c,v 1.101 2008/04/08 20:25:00 njoly Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_exec.c,v 1.102 2008/04/11 16:47:50 njoly Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -333,7 +333,8 @@ linux_nptl_proc_exit(struct proc *p)
printf("%s:%d e->s->group_pid = %d, p->p_pid = %d, flags = 0x%x\n",
__func__, __LINE__, e->s->group_pid, p->p_pid, e->s->flags);
#endif
- if (e->s->group_pid != p->p_pid) {
+ if ((e->s->group_pid != p->p_pid) &&
+ (e->clone_flags & LINUX_CLONE_THREAD)) {
proc_reparent(p, initproc);
cv_broadcast(&initproc->p_waitcv);
}