diff options
author | Mark Johnston <markj@FreeBSD.org> | 2013-11-18 03:24:50 +0000 |
---|---|---|
committer | Mark Johnston <markj@FreeBSD.org> | 2013-11-18 03:24:50 +0000 |
commit | dd580326fe801fe886a8c3c521d3b6a8f17e4312 (patch) | |
tree | 15998393a56b386ff295211f3f8160ab2ba9e5b2 /sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c | |
parent | be1938b303277ba5f2a9a21c5a6ed3cd42d7dc29 (diff) | |
download | src-dd580326fe801fe886a8c3c521d3b6a8f17e4312.tar.gz src-dd580326fe801fe886a8c3c521d3b6a8f17e4312.zip |
The fasttrap ioctl used to create probes takes a variable-sized argument.
It was not being correctly copied into the kernel on FreeBSD, and as a
result, probes with multiple probe sites were not being created properly.
To fix this, change the ioctl definition so that the fasttrap ioctl handler
is responsible for copying in userland data.
Submitted by: Prashanth Kumar <pra_udupi@yahoo.co.in>
MFC after: 1 month
Notes
Notes:
svn path=/head/; revision=258291
Diffstat (limited to 'sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c')
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c b/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c index fd5508fcda68..bf46eb79ca03 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c +++ b/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c @@ -2064,20 +2064,16 @@ fasttrap_ioctl(struct cdev *dev, u_long cmd, caddr_t arg, int fflag, return (EAGAIN); if (cmd == FASTTRAPIOC_MAKEPROBE) { - fasttrap_probe_spec_t *uprobe = (void *)arg; + fasttrap_probe_spec_t *uprobe = *(fasttrap_probe_spec_t **)arg; fasttrap_probe_spec_t *probe; uint64_t noffs; size_t size; int ret; char *c; -#if defined(sun) if (copyin(&uprobe->ftps_noffs, &noffs, sizeof (uprobe->ftps_noffs))) return (EFAULT); -#else - noffs = uprobe->ftps_noffs; -#endif /* * Probes must have at least one tracepoint. @@ -2093,19 +2089,10 @@ fasttrap_ioctl(struct cdev *dev, u_long cmd, caddr_t arg, int fflag, probe = kmem_alloc(size, KM_SLEEP); -#if defined(sun) if (copyin(uprobe, probe, size) != 0) { kmem_free(probe, size); return (EFAULT); } -#else - memcpy(probe, uprobe, sizeof(*probe)); - if (noffs > 1 && copyin(uprobe + 1, probe + 1, size) != 0) { - kmem_free(probe, size); - return (EFAULT); - } -#endif - /* * Verify that the function and module strings contain no |