summaryrefslogtreecommitdiffstats
path: root/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2016-05-09 17:39:11 -0300
committerRenato Botelho <renato@netgate.com>2016-05-09 17:39:11 -0300
commiteb1aa95459d780e1328d821fd6af261c2221a62b (patch)
treed0c75db0de1902022252ffee3acbfe775366214c /sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
parent4a578420216361b8acfb7296dd0b68c805e5121b (diff)
parent1708fafa25d9413ab466d3670d803e2ebf885d45 (diff)
downloadFreeBSD-src-eb1aa95459d780e1328d821fd6af261c2221a62b.zip
FreeBSD-src-eb1aa95459d780e1328d821fd6af261c2221a62b.tar.gz
Merge remote-tracking branch 'origin/stable/10' into devel
Diffstat (limited to 'sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c')
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
index 9266ffc..ed99c4b 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
@@ -9295,6 +9295,10 @@ dtrace_helper_provide_one(dof_helper_t *dhp, dof_sec_t *sec, pid_t pid)
probe = (dof_probe_t *)(uintptr_t)(daddr +
prb_sec->dofs_offset + i * prb_sec->dofs_entsize);
+ /* See the check in dtrace_helper_provider_validate(). */
+ if (strlen(strtab + probe->dofpr_func) >= DTRACE_FUNCNAMELEN)
+ continue;
+
dhpb.dthpb_mod = dhp->dofhp_mod;
dhpb.dthpb_func = strtab + probe->dofpr_func;
dhpb.dthpb_name = strtab + probe->dofpr_name;
@@ -15805,7 +15809,13 @@ dtrace_helper_provider_validate(dof_hdr_t *dof, dof_sec_t *sec)
if (strlen(strtab + probe->dofpr_func) >= DTRACE_FUNCNAMELEN) {
dtrace_dof_error(dof, "function name too long");
- return (-1);
+ /*
+ * Keep going if the function name is too long.
+ * Unlike provider and probe names, we cannot reasonably
+ * impose restrictions on function names, since they're
+ * a property of the code being instrumented. We will
+ * skip this probe in dtrace_helper_provide_one().
+ */
}
if (probe->dofpr_name >= str_sec->dofs_size ||
OpenPOWER on IntegriCloud