Don't try to kill embryonic processes in killpg1(). This prevents
a race condition between fork() and kill(pid,sig) with pid < 0 that can cause a kernel panic. Submitted by: up MFC after: 3 weeks
This commit is contained in:
parent
2237f11344
commit
95f16c1e2c
@ -1674,7 +1674,7 @@ killpg1(td, sig, pgid, all)
|
||||
LIST_FOREACH(p, &allproc, p_list) {
|
||||
PROC_LOCK(p);
|
||||
if (p->p_pid <= 1 || p->p_flag & P_SYSTEM ||
|
||||
p == td->td_proc) {
|
||||
p == td->td_proc || p->p_state == PRS_NEW) {
|
||||
PROC_UNLOCK(p);
|
||||
continue;
|
||||
}
|
||||
@ -1704,7 +1704,8 @@ killpg1(td, sig, pgid, all)
|
||||
sx_sunlock(&proctree_lock);
|
||||
LIST_FOREACH(p, &pgrp->pg_members, p_pglist) {
|
||||
PROC_LOCK(p);
|
||||
if (p->p_pid <= 1 || p->p_flag & P_SYSTEM) {
|
||||
if (p->p_pid <= 1 || p->p_flag & P_SYSTEM ||
|
||||
p->p_state == PRS_NEW ) {
|
||||
PROC_UNLOCK(p);
|
||||
continue;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user