diff options
author | netchild <netchild@FreeBSD.org> | 2007-02-23 22:29:24 +0000 |
---|---|---|
committer | netchild <netchild@FreeBSD.org> | 2007-02-23 22:29:24 +0000 |
commit | d0c562e57ca3e3905157ccbd79fa4efa843088c3 (patch) | |
tree | 4e6abc816067867f3758ee33db1635ea1c2c3dad /sys/compat | |
parent | 6b3b8d08bd9f40733887a508b11b80500a053bf8 (diff) | |
download | FreeBSD-src-d0c562e57ca3e3905157ccbd79fa4efa843088c3.zip FreeBSD-src-d0c562e57ca3e3905157ccbd79fa4efa843088c3.tar.gz |
MFp4 (part of 114132):
- Fix a LOR caused by holding emul_lock and proctree_lock at once.
Submitted by: rdivacky
Diffstat (limited to 'sys/compat')
-rw-r--r-- | sys/compat/linux/linux_emul.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/sys/compat/linux/linux_emul.c b/sys/compat/linux/linux_emul.c index 116eb11..2a42f70 100644 --- a/sys/compat/linux/linux_emul.c +++ b/sys/compat/linux/linux_emul.c @@ -168,19 +168,20 @@ linux_proc_exit(void *arg __unused, struct proc *p) /* reparent all procs that are not a thread leader to initproc */ if (em->shared->group_pid != p->p_pid) { - sx_xlock(&proctree_lock); - wakeup(initproc); + child_clear_tid = em->child_clear_tid; + EMUL_UNLOCK(&emul_lock); + sx_xlock(&proctree_lock); + wakeup(initproc); PROC_LOCK(p); proc_reparent(p, initproc); p->p_sigparent = SIGCHLD; PROC_UNLOCK(p); - sx_xunlock(&proctree_lock); + sx_xunlock(&proctree_lock); + } else { + child_clear_tid = em->child_clear_tid; + EMUL_UNLOCK(&emul_lock); } - child_clear_tid = em->child_clear_tid; - - EMUL_UNLOCK(&emul_lock); - EMUL_SHARED_WLOCK(&emul_shared_lock); LIST_REMOVE(em, threads); |