From owner-svn-src-head@FreeBSD.ORG Sat Oct 6 19:23:45 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8FE94106566C; Sat, 6 Oct 2012 19:23:45 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7A94B8FC08; Sat, 6 Oct 2012 19:23:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q96JNjDE024625; Sat, 6 Oct 2012 19:23:45 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q96JNjgQ024623; Sat, 6 Oct 2012 19:23:45 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201210061923.q96JNjgQ024623@svn.freebsd.org> From: Andriy Gapon Date: Sat, 6 Oct 2012 19:23:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r241281 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Oct 2012 19:23:45 -0000 Author: avg Date: Sat Oct 6 19:23:44 2012 New Revision: 241281 URL: http://svn.freebsd.org/changeset/base/241281 Log: ktrace/kern_exec: check p_tracecred instead of p_cred .. when deciding whether to continue tracing across suid/sgid exec. Otherwise if root ktrace-d an unprivileged process and the processed exec-ed a suid program, then tracing didn't continue across exec. Reviewed by: bde, kib MFC after: 22 days Modified: head/sys/kern/kern_exec.c Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Sat Oct 6 19:19:32 2012 (r241280) +++ head/sys/kern/kern_exec.c Sat Oct 6 19:23:44 2012 (r241281) @@ -691,7 +691,8 @@ interpret: setsugid(p); #ifdef KTRACE - if (priv_check_cred(oldcred, PRIV_DEBUG_DIFFCRED, 0)) + if (p->p_tracecred != NULL && + priv_check_cred(p->p_tracecred, PRIV_DEBUG_DIFFCRED, 0)) ktrprocexec(p, &tracecred, &tracevp); #endif /*