From 0c0be4e82677a2d8fb49b7a70676bf359e7360b0 Mon Sep 17 00:00:00 2001 From: jake Date: Wed, 22 Nov 2000 07:42:04 +0000 Subject: 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 --- sys/kern/kern_sig.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'sys/kern/kern_sig.c') 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. -- cgit v1.1