From owner-svn-src-all@FreeBSD.ORG Fri May 22 11:03:52 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BD5F04CF; Fri, 22 May 2015 11:03:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AB7E31410; Fri, 22 May 2015 11:03:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4MB3qak054780; Fri, 22 May 2015 11:03:52 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4MB3qR4054779; Fri, 22 May 2015 11:03:52 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201505221103.t4MB3qR4054779@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 22 May 2015 11:03:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283281 - head/sys/fs/procfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 May 2015 11:03:52 -0000 Author: jhb Date: Fri May 22 11:03:51 2015 New Revision: 283281 URL: https://svnweb.freebsd.org/changeset/base/283281 Log: Always set p_oppid when attaching to an existing process via procfs tracing. This matches the behavior of ptrace(PT_ATTACH). Also, the procfs detach request assumes p_oppid is always set. Reviewed by: kib MFC after: 2 weeks Modified: head/sys/fs/procfs/procfs_ctl.c Modified: head/sys/fs/procfs/procfs_ctl.c ============================================================================== --- head/sys/fs/procfs/procfs_ctl.c Fri May 22 09:03:55 2015 (r283280) +++ head/sys/fs/procfs/procfs_ctl.c Fri May 22 11:03:51 2015 (r283281) @@ -143,8 +143,8 @@ procfs_control(struct thread *td, struct p->p_flag |= P_TRACED; faultin(p); p->p_xstat = 0; /* XXX ? */ + p->p_oppid = p->p_pptr->p_pid; if (p->p_pptr != td->td_proc) { - p->p_oppid = p->p_pptr->p_pid; proc_reparent(p, td->td_proc); } kern_psignal(p, SIGSTOP);