summaryrefslogtreecommitdiffstats
path: root/sys/cddl
diff options
context:
space:
mode:
authormarkj <markj@FreeBSD.org>2015-09-11 03:06:34 +0000
committermarkj <markj@FreeBSD.org>2015-09-11 03:06:34 +0000
commit3ff7032ecdcf849960103d5e02a6ff33abfed3ce (patch)
tree36db95fdb44062be4268f4e43736a6737a66cb06 /sys/cddl
parent399d2d3d73d1917cfc358846c96cc1682643abe2 (diff)
downloadFreeBSD-src-3ff7032ecdcf849960103d5e02a6ff33abfed3ce.zip
FreeBSD-src-3ff7032ecdcf849960103d5e02a6ff33abfed3ce.tar.gz
MFV r283513:
5930 fasttrap_pid_enable() panics when prfind() fails in forking process Reviewed by: Adam Leventhal <ahl@delphix.com> Reviewed by: Gordon Ross <gordon.ross@nexenta.com> Approved by: Richard Lowe <richlowe@richlowe.net> Author: Bryan Cantrill <bryan@joyent.com> illumos/illumos-gate@9df7e4e12eb093557252d3bec029b5c382613e36
Diffstat (limited to 'sys/cddl')
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c b/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c
index b44de1d..df48567 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c
@@ -29,7 +29,7 @@
*/
/*
- * Copyright (c) 2013, Joyent, Inc. All rights reserved.
+ * Copyright (c) 2015, Joyent, Inc. All rights reserved.
*/
#include <sys/atomic.h>
@@ -1190,11 +1190,21 @@ fasttrap_pid_enable(void *arg, dtrace_id_t id, void *parg)
mutex_enter(&pidlock);
p = prfind(probe->ftp_pid);
+ if (p == NULL) {
+ /*
+ * So it's not that the target process is being born,
+ * it's that it isn't there at all (and we simply
+ * happen to be forking). Anyway, we know that the
+ * target is definitely gone, so bail out.
+ */
+ mutex_exit(&pidlock);
+ return (0);
+ }
+
/*
* Confirm that curproc is indeed forking the process in which
* we're trying to enable probes.
*/
- ASSERT(p != NULL);
ASSERT(p->p_parent == curproc);
ASSERT(p->p_stat == SIDL);
OpenPOWER on IntegriCloud