From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 13:11:16 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C2D0B92F; Mon, 17 Feb 2014 13:11:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 93CE21FAD; Mon, 17 Feb 2014 13:11:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HDBGnn052760; Mon, 17 Feb 2014 13:11:16 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HDBGlW052565; Mon, 17 Feb 2014 13:11:16 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171311.s1HDBGlW052565@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 13:11:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262048 - in stable/10/sys/cddl/contrib/opensolaris/uts/common: dtrace sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 13:11:16 -0000 Author: avg Date: Mon Feb 17 13:11:15 2014 New Revision: 262048 URL: http://svnweb.freebsd.org/changeset/base/262048 Log: MFC r258291: change the ioctl definition so that the fasttrap ioctl handler is responsible for copying in userland data Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Mon Feb 17 13:08:20 2014 (r262047) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Mon Feb 17 13:11:15 2014 (r262048) @@ -2064,20 +2064,16 @@ fasttrap_ioctl(struct cdev *dev, u_long 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 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 Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap.h Mon Feb 17 13:08:20 2014 (r262047) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap.h Mon Feb 17 13:11:15 2014 (r262048) @@ -42,8 +42,8 @@ extern "C" { #define FASTTRAPIOC_MAKEPROBE (FASTTRAPIOC | 1) #define FASTTRAPIOC_GETINSTR (FASTTRAPIOC | 2) #else -#define FASTTRAPIOC_MAKEPROBE _IOW('f', 1, fasttrap_probe_spec_t) #define FASTTRAPIOC_GETINSTR _IOWR('f', 2, uint8_t) +#define FASTTRAPIOC_MAKEPROBE _IO('f', 3) #endif typedef enum fasttrap_probe_type {