Author: delphij
Date: Mon Jun 15 18:16:23 2015
New Revision: 284418
URL: https://svnweb.freebsd.org/changeset/base/284418

Log:
  MFC r283889,r283891:
  
  Clear p_stops when doing PT_DETACH and PROCFS_CTL_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.

Modified:
  stable/10/sys/fs/procfs/procfs_ctl.c
  stable/10/sys/kern/sys_process.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/fs/procfs/procfs_ctl.c
==============================================================================
--- stable/10/sys/fs/procfs/procfs_ctl.c        Mon Jun 15 15:34:20 2015        
(r284417)
+++ stable/10/sys/fs/procfs/procfs_ctl.c        Mon Jun 15 18:16:23 2015        
(r284418)
@@ -235,6 +235,7 @@ out:
                } else
                        PROC_LOCK(p);
                p->p_oppid = 0;
+               p->p_stops = 0;
                p->p_flag &= ~P_WAITED; /* XXX ? */
                sx_xunlock(&proctree_lock);
 

Modified: stable/10/sys/kern/sys_process.c
==============================================================================
--- stable/10/sys/kern/sys_process.c    Mon Jun 15 15:34:20 2015        
(r284417)
+++ stable/10/sys/kern/sys_process.c    Mon Jun 15 18:16:23 2015        
(r284418)
@@ -963,6 +963,7 @@ kern_ptrace(struct thread *td, int req, 
                                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); */
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to