]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/commit
MFC kernel fixes to userland dtrace support.
authorgibbs <gibbs@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Wed, 13 Mar 2013 17:34:42 +0000 (17:34 +0000)
committergibbs <gibbs@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Wed, 13 Mar 2013 17:34:42 +0000 (17:34 +0000)
commit90e5147bfa8a9cffa0a008f874ff19816abe1726
tree1adb2eec1a004fa98f21b4e1afc20c46d8e589ab
parenta99d3147ef926f87fe08beedbe04021b5bcac182
MFC kernel fixes to userland dtrace support.

r247049
-------
Avoid panic when tearing down the DTrace pid provider for a
process that has crashed.

sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c:
In fasttrap_pid_disable(), we cannot PHOLD the proc
structure for a process that no longer exists, but
we still have other, fasttrap specific, state that
must be cleaned up for probes that existed in the
dead process.  Instead of returning early if the
process related to our probes isn't found,
conditionalize the locking and carry on with a NULL
proc pointer.  The rest of the fasttrap code already
understands that a NULL proc is possible and does
the right things in this case.

r247820
-------
Fix assertion failure when using userland DTrace probes from
the pid provider on a kernel compiled with INVARIANTS.

sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c:
In fasttrap_probe_pid(), attempts to write to the
address space of the thread that fired the probe
must be performed with the process of the thread
held.  Use _PHOLD() to ensure this is the case.

In fasttrap_probe_pid(), use proc_write_regs() instead
of calling set_regs() directly.  proc_write_regs()
performs invariant checks to verify the calling
environment of set_regs().  PROC_LOCK()/UNLOCK() around
the call to proc_write_regs() so that it's invariants
are satisfied.

Sponsored by: Spectra Logic Corporation

git-svn-id: svn://svn.freebsd.org/base/stable/9@248248 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c
sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c