summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_fork.c
diff options
context:
space:
mode:
authortanimura <tanimura@FreeBSD.org>2002-04-02 17:12:06 +0000
committertanimura <tanimura@FreeBSD.org>2002-04-02 17:12:06 +0000
commit448edc64b41e8d0220c4eaa170ff10164700ec44 (patch)
treef99460f08fd6efa937839d0462a49446be5160d7 /sys/kern/kern_fork.c
parenteb20435a6906b433f62bf89933bc486aa0ecde07 (diff)
downloadFreeBSD-src-448edc64b41e8d0220c4eaa170ff10164700ec44.zip
FreeBSD-src-448edc64b41e8d0220c4eaa170ff10164700ec44.tar.gz
Fix leakage of p_pgrp lock.
Diffstat (limited to 'sys/kern/kern_fork.c')
-rw-r--r--sys/kern/kern_fork.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c
index 8782007..ec959d5 100644
--- a/sys/kern/kern_fork.c
+++ b/sys/kern/kern_fork.c
@@ -538,6 +538,8 @@ again:
FILEDESC_UNLOCK(p1->p_fd);
} else
fd = fdshare(p1);
+ PGRPSESS_XLOCK();
+ PGRP_LOCK(p1->p_pgrp);
PROC_LOCK(p2);
p2->p_fd = fd;
@@ -570,6 +572,8 @@ again:
LIST_INSERT_AFTER(p1, p2, p_pglist);
PROC_UNLOCK(p1);
PROC_UNLOCK(p2);
+ PGRP_UNLOCK(p1->p_pgrp);
+ PGRPSESS_XUNLOCK();
/*
* Attach the new process to its parent.
OpenPOWER on IntegriCloud