diff options
author | mbr <mbr@FreeBSD.org> | 2006-09-23 17:35:24 +0000 |
---|---|---|
committer | mbr <mbr@FreeBSD.org> | 2006-09-23 17:35:24 +0000 |
commit | f58415b4f5d9fbf74188d4258c2a61bba390eaa5 (patch) | |
tree | ee297529719362096682efc79261b4262cf1db59 /sys | |
parent | f6e5dafda977f33fc23ea4eaf46e8018231afeb3 (diff) | |
download | FreeBSD-src-f58415b4f5d9fbf74188d4258c2a61bba390eaa5.zip FreeBSD-src-f58415b4f5d9fbf74188d4258c2a61bba390eaa5.tar.gz |
Protect enterpgrp() against another tty/proc race case until the tty locking work
has been fixed.
MFC after: 1 week
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/kern_proc.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index e7b3460..1250e7b 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -313,6 +313,7 @@ enterpgrp(p, pgid, pgrp, sess) PROC_LOCK(p); p->p_flag &= ~P_CONTROLT; PROC_UNLOCK(p); + mtx_lock(&Giant); /* XXX TTY */ PGRP_LOCK(pgrp); sess->s_leader = p; sess->s_sid = p->p_pid; @@ -325,6 +326,7 @@ enterpgrp(p, pgid, pgrp, sess) KASSERT(p == curproc, ("enterpgrp: mksession and p != curproc")); } else { + mtx_lock(&Giant); /* XXX TTY */ pgrp->pg_session = p->p_session; SESS_LOCK(pgrp->pg_session); pgrp->pg_session->s_count++; @@ -342,6 +344,7 @@ enterpgrp(p, pgid, pgrp, sess) pgrp->pg_jobc = 0; SLIST_INIT(&pgrp->pg_sigiolst); PGRP_UNLOCK(pgrp); + mtx_unlock(&Giant); /* XXX TTY */ doenterpgrp(p, pgrp); |