From owner-svn-src-all@FreeBSD.ORG Wed Jul 16 02:02:48 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 3EE5D408; Wed, 16 Jul 2014 02:02:48 +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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1F7E02DFF; Wed, 16 Jul 2014 02:02:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6G22lwO050553; Wed, 16 Jul 2014 02:02:47 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6G22kbJ050551; Wed, 16 Jul 2014 02:02:46 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201407160202.s6G22kbJ050551@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Wed, 16 Jul 2014 02:02:46 +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: r268734 - in stable/10/sys: cddl/contrib/opensolaris/uts/common/dtrace modules/dtrace/fasttrap 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.18 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: Wed, 16 Jul 2014 02:02:48 -0000 Author: pfg Date: Wed Jul 16 02:02:46 2014 New Revision: 268734 URL: http://svnweb.freebsd.org/changeset/base/268734 Log: MFC r268097: MFV r260708 4427 pid provider rejects probes with valid UTF-8 names This make use of Solaris' u8_validate() which we happen to use since r185029 for ZFS. Use of u8_textprep.c required -Wno-cast-qual for powerpc. Illumos Revision: 1444d846b126463eb1059a572ff114d51f7562e5 Reference: https://www.illumos.org/issues/4427 Obtained from: Illumos Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c stable/10/sys/modules/dtrace/fasttrap/Makefile 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 Wed Jul 16 00:43:53 2014 (r268733) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Wed Jul 16 02:02:46 2014 (r268734) @@ -28,9 +28,9 @@ * Use is subject to license terms. */ -#if defined(sun) -#pragma ident "%Z%%M% %I% %E% SMI" -#endif +/* + * Copyright (c) 2013, Joyent, Inc. All rights reserved. + */ #include #include @@ -63,6 +63,7 @@ #if !defined(sun) #include #include +#include #include #endif @@ -2068,8 +2069,7 @@ fasttrap_ioctl(struct cdev *dev, u_long fasttrap_probe_spec_t *probe; uint64_t noffs; size_t size; - int ret; - char *c; + int ret, err; if (copyin(&uprobe->ftps_noffs, &noffs, sizeof (uprobe->ftps_noffs))) @@ -2099,18 +2099,16 @@ fasttrap_ioctl(struct cdev *dev, u_long * Verify that the function and module strings contain no * funny characters. */ - for (c = &probe->ftps_func[0]; *c != '\0'; c++) { - if (*c < 0x20 || 0x7f <= *c) { - ret = EINVAL; - goto err; - } + if (u8_validate(probe->ftps_func, strlen(probe->ftps_func), + NULL, U8_VALIDATE_ENTIRE, &err) < 0) { + ret = EINVAL; + goto err; } - for (c = &probe->ftps_mod[0]; *c != '\0'; c++) { - if (*c < 0x20 || 0x7f <= *c) { - ret = EINVAL; - goto err; - } + if (u8_validate(probe->ftps_mod, strlen(probe->ftps_mod), + NULL, U8_VALIDATE_ENTIRE, &err) < 0) { + ret = EINVAL; + goto err; } #ifdef notyet Modified: stable/10/sys/modules/dtrace/fasttrap/Makefile ============================================================================== --- stable/10/sys/modules/dtrace/fasttrap/Makefile Wed Jul 16 00:43:53 2014 (r268733) +++ stable/10/sys/modules/dtrace/fasttrap/Makefile Wed Jul 16 02:02:46 2014 (r268734) @@ -18,9 +18,13 @@ CFLAGS+= -I${.CURDIR}/../../../cddl/cont .PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/uts/powerpc/dtrace .endif +.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/common/unicode +SRCS+= u8_textprep.c + CFLAGS+= -DSMP .include CFLAGS+= -include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h +CWARNFLAGS+= -Wno-cast-qual CWARNFLAGS+= -Wno-unused