svn commit: r287230 - stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace
Mark Johnston
markj at FreeBSD.org
Thu Aug 27 23:55:47 UTC 2015
Author: markj
Date: Thu Aug 27 23:55:46 2015
New Revision: 287230
URL: https://svnweb.freebsd.org/changeset/base/287230
Log:
MFC r286167:
Avoid dereferencing curthread->td_proc->p_cred in DTrace probe context.
Modified:
stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
==============================================================================
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Thu Aug 27 23:52:53 2015 (r287229)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Thu Aug 27 23:55:46 2015 (r287230)
@@ -3510,7 +3510,6 @@ dtrace_dif_variable(dtrace_mstate_t *mst
*/
if (DTRACE_ANCHORED(mstate->dtms_probe) && CPU_ON_INTR(CPU))
return ((uint64_t)p0.p_cred->cr_uid);
-#endif
/*
* It is always safe to dereference one's own t_procp pointer:
@@ -3522,6 +3521,9 @@ dtrace_dif_variable(dtrace_mstate_t *mst
* credential, since this is never NULL after process birth.
*/
return ((uint64_t)curthread->t_procp->p_cred->cr_uid);
+#else
+ return ((uint64_t)curthread->td_ucred->cr_uid);
+#endif
case DIF_VAR_GID:
if (!dtrace_priv_proc(state))
@@ -3533,7 +3535,6 @@ dtrace_dif_variable(dtrace_mstate_t *mst
*/
if (DTRACE_ANCHORED(mstate->dtms_probe) && CPU_ON_INTR(CPU))
return ((uint64_t)p0.p_cred->cr_gid);
-#endif
/*
* It is always safe to dereference one's own t_procp pointer:
@@ -3545,6 +3546,9 @@ dtrace_dif_variable(dtrace_mstate_t *mst
* credential, since this is never NULL after process birth.
*/
return ((uint64_t)curthread->t_procp->p_cred->cr_gid);
+#else
+ return ((uint64_t)curthread->td_ucred->cr_gid);
+#endif
case DIF_VAR_ERRNO: {
#if defined(sun)
More information about the svn-src-stable
mailing list