mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-15 15:06:42 +00:00
Move sigqueue_take() call into proc_reparent(), this fixed bugs where
proc_reparent() is called but sigqueue_take() is forgotten.
This commit is contained in:
parent
5b7aaa1a15
commit
ff7668079f
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=163676
@ -197,10 +197,6 @@ exit1(struct thread *td, int rv)
|
||||
while (p->p_lock > 0)
|
||||
msleep(&p->p_lock, &p->p_mtx, PWAIT, "exithold", 0);
|
||||
|
||||
PROC_LOCK(p->p_pptr);
|
||||
sigqueue_take(p->p_ksi);
|
||||
PROC_UNLOCK(p->p_pptr);
|
||||
|
||||
PROC_UNLOCK(p);
|
||||
|
||||
#ifdef AUDIT
|
||||
@ -903,6 +899,9 @@ proc_reparent(struct proc *child, struct proc *parent)
|
||||
if (child->p_pptr == parent)
|
||||
return;
|
||||
|
||||
PROC_LOCK(child->p_pptr);
|
||||
sigqueue_take(child->p_ksi);
|
||||
PROC_UNLOCK(child->p_pptr);
|
||||
LIST_REMOVE(child, p_sibling);
|
||||
LIST_INSERT_HEAD(&parent->p_children, child, p_sibling);
|
||||
child->p_pptr = parent;
|
||||
|
@ -690,12 +690,8 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data)
|
||||
/* security check done above */
|
||||
p->p_flag |= P_TRACED;
|
||||
p->p_oppid = p->p_pptr->p_pid;
|
||||
if (p->p_pptr != td->td_proc) {
|
||||
PROC_LOCK(p->p_pptr);
|
||||
sigqueue_take(p->p_ksi);
|
||||
PROC_UNLOCK(p->p_pptr);
|
||||
if (p->p_pptr != td->td_proc)
|
||||
proc_reparent(p, td->td_proc);
|
||||
}
|
||||
data = SIGSTOP;
|
||||
goto sendsig; /* in PT_CONTINUE below */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user