mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-10-28 19:34:43 +01:00
kthread_add(): do not allow to attach the thread to a dead or dying process
Reported by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week
This commit is contained in:
1 parent
ba675bb948
commit
9636299233
1 file changed
+4
@@ -281,6 +281,10 @@ kthread_add1(void (*func)(void *), void *arg, struct proc *p,
|
||||
return (ENOMEM);
|
||||
|
||||
PROC_LOCK(p);
|
||||
if (p->p_state == PRS_ZOMBIE || (p->p_flag2 & P2_WEXIT) != 0) {
|
||||
PROC_UNLOCK(p);
|
||||
return (ESRCH);
|
||||
}
|
||||
oldtd = FIRST_THREAD_IN_PROC(p);
|
||||
|
||||
bzero(&newtd->td_startzero,
|
||||
|
||||
Reference in new issue
Block a user