diff options
author | netchild <netchild@FreeBSD.org> | 2007-01-07 19:09:20 +0000 |
---|---|---|
committer | netchild <netchild@FreeBSD.org> | 2007-01-07 19:09:20 +0000 |
commit | 10ec776aee8b4bf7ab4e9506ccb9af366e7bcb86 (patch) | |
tree | db5633e7d69cc1cc01f21fff33065a772f55908a /sys/compat/linux/linux_emul.c | |
parent | 977ef4a8bc07aa2c92b23e4bb7186faa23962c01 (diff) | |
download | FreeBSD-src-10ec776aee8b4bf7ab4e9506ccb9af366e7bcb86.zip FreeBSD-src-10ec776aee8b4bf7ab4e9506ccb9af366e7bcb86.tar.gz |
MFp4 (112499):
Protect em->shared with the lock in case of CLONE_THREAD.
Submitted by: rdivacky
Diffstat (limited to 'sys/compat/linux/linux_emul.c')
-rw-r--r-- | sys/compat/linux/linux_emul.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/compat/linux/linux_emul.c b/sys/compat/linux/linux_emul.c index 4083f53..a06e231 100644 --- a/sys/compat/linux/linux_emul.c +++ b/sys/compat/linux/linux_emul.c @@ -119,10 +119,12 @@ linux_proc_init(struct thread *td, pid_t child, int flags) if (child != 0) { if (flags & CLONE_THREAD) { /* lookup the parent */ + EMUL_SHARED_WLOCK(&emul_shared_lock); p_em = em_find(td->td_proc, EMUL_DONTLOCK); KASSERT(p_em != NULL, ("proc_init: parent emuldata not found for CLONE_THREAD\n")); em->shared = p_em->shared; em->shared->refs++; + EMUL_SHARED_WUNLOCK(&emul_shared_lock); } else { /* * handled earlier to avoid malloc(M_WAITOK) with |