summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2015-06-01 18:15:45 +0000
committerdelphij <delphij@FreeBSD.org>2015-06-01 18:15:45 +0000
commit0226e94a1c2ebe5ced18af471f56cb99051622f8 (patch)
tree53b55849704496af3ae82ae2dbad43303649c946 /sys
parent2898b805c5ccfcd47e3d09de91d4b117fdba88e5 (diff)
downloadFreeBSD-src-0226e94a1c2ebe5ced18af471f56cb99051622f8.zip
FreeBSD-src-0226e94a1c2ebe5ced18af471f56cb99051622f8.tar.gz
Clear p_stops when doing PT_DETACH.
Without this, if a process was being traced by truss(1), which uses different p_stops bits than gdb(1), the latter would misbehave because of the unexpected bits. Reported by: jceel Submitted by: sef Sponsored by: iXsystems, Inc. MFC after: 2 weeks
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/sys_process.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c
index 3bf2db8..09a43f4 100644
--- a/sys/kern/sys_process.c
+++ b/sys/kern/sys_process.c
@@ -963,6 +963,7 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data)
CTR1(KTR_PTRACE, "PT_DETACH: pid %d", p->p_pid);
p->p_oppid = 0;
p->p_flag &= ~(P_TRACED | P_WAITED | P_FOLLOWFORK);
+ p->p_stops = 0;
/* should we send SIGCHLD? */
/* childproc_continued(p); */
OpenPOWER on IntegriCloud