diff options
author | jake <jake@FreeBSD.org> | 2000-11-22 07:42:04 +0000 |
---|---|---|
committer | jake <jake@FreeBSD.org> | 2000-11-22 07:42:04 +0000 |
commit | 0c0be4e82677a2d8fb49b7a70676bf359e7360b0 (patch) | |
tree | a0c32260edfde6d861e66b11172147608684043e /sys/kern/kern_sig.c | |
parent | 1b544875743d53491a096b0c757bf30ce73bb83b (diff) | |
download | FreeBSD-src-0c0be4e82677a2d8fb49b7a70676bf359e7360b0.zip FreeBSD-src-0c0be4e82677a2d8fb49b7a70676bf359e7360b0.tar.gz |
Protect the following with a lockmgr lock:
allproc
zombproc
pidhashtbl
proc.p_list
proc.p_hash
nextpid
Reviewed by: jhb
Obtained from: BSD/OS and netbsd
Diffstat (limited to 'sys/kern/kern_sig.c')
-rw-r--r-- | sys/kern/kern_sig.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index a49964e..345bc31 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -850,10 +850,11 @@ killpg1(cp, sig, pgid, all) struct pgrp *pgrp; int nfound = 0; - if (all) + if (all) { /* * broadcast */ + lockmgr(&allproc_lock, LK_SHARED, NULL, CURPROC); LIST_FOREACH(p, &allproc, p_list) { if (p->p_pid <= 1 || p->p_flag & P_SYSTEM || p == cp || !CANSIGNAL(cp, p, sig)) @@ -862,7 +863,8 @@ killpg1(cp, sig, pgid, all) if (sig) psignal(p, sig); } - else { + lockmgr(&allproc_lock, LK_RELEASE, NULL, CURPROC); + } else { if (pgid == 0) /* * zero pgid means send to my process group. |