1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-15 10:17:20 +00:00

In wait1(), remove the zombie process from zombproc before removing

it from its pgrp to avoid leaving zombies around with p_pgrp == NULL.
This bug was apparent as a NULL-dereference in the pid selection code
in fork1().
This commit is contained in:
Tim J. Robbins 2003-03-12 11:10:04 +00:00
parent 9eb8572ea2
commit 3890793e9c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=112139

View File

@ -657,17 +657,17 @@ wait1(td, uap, compat)
mtx_unlock(&Giant);
return (0);
}
/*
* Remove other references to this process to ensure
* we have an exclusive reference.
*/
leavepgrp(p);
sx_xlock(&allproc_lock);
LIST_REMOVE(p, p_list); /* off zombproc */
sx_xunlock(&allproc_lock);
LIST_REMOVE(p, p_sibling);
/*
* Remove other references to this process to ensure
* we have an exclusive reference.
*/
leavepgrp(p);
sx_xunlock(&proctree_lock);
/*