mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-15 10:17:20 +00:00
When reparenting a process to init, make sure that p_sigparent is
set to SIGCHLD. This avoids the creation of orphaned Linux-threaded zombies that init is unable to reap. This can occur when the parent process sets its SIGCHLD to SIG_IGN. Fix a similar situation in the PT_DETACH code. Tested by: "Steven Hartland" <killing AT multiplay.co.uk>
This commit is contained in:
parent
40d387429f
commit
55b5f2a202
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=125720
@ -458,6 +458,7 @@ exit1(struct thread *td, int rv)
|
||||
pp = p->p_pptr;
|
||||
PROC_UNLOCK(pp);
|
||||
proc_reparent(p, initproc);
|
||||
p->p_sigparent = SIGCHLD;
|
||||
PROC_LOCK(p->p_pptr);
|
||||
/*
|
||||
* If this was the last child of our parent, notify
|
||||
|
@ -561,6 +561,7 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data)
|
||||
PROC_UNLOCK(pp);
|
||||
PROC_LOCK(p);
|
||||
proc_reparent(p, pp);
|
||||
p->p_sigparent = SIGCHLD;
|
||||
}
|
||||
p->p_flag &= ~(P_TRACED | P_WAITED);
|
||||
p->p_oppid = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user