From owner-svn-src-all@FreeBSD.ORG Thu Jan 16 12:53:02 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 13AD3EDB; Thu, 16 Jan 2014 12:53:02 +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 F3C8915BB; Thu, 16 Jan 2014 12:53:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0GCr1RZ095595; Thu, 16 Jan 2014 12:53:01 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0GCr1h9095594; Thu, 16 Jan 2014 12:53:01 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201401161253.s0GCr1h9095594@svn.freebsd.org> From: Andriy Gapon Date: Thu, 16 Jan 2014 12:53:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r260708 - vendor-sys/illumos/dist/uts/common/dtrace X-SVN-Group: vendor-sys 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: Thu, 16 Jan 2014 12:53:02 -0000 Author: avg Date: Thu Jan 16 12:53:01 2014 New Revision: 260708 URL: http://svnweb.freebsd.org/changeset/base/260708 Log: 4427 pid provider rejects probes with valid UTF-8 names illumos/illumos-gate@1444d846b126463eb1059a572ff114d51f7562e5 Modified: vendor-sys/illumos/dist/uts/common/dtrace/fasttrap.c Modified: vendor-sys/illumos/dist/uts/common/dtrace/fasttrap.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/dtrace/fasttrap.c Thu Jan 16 12:35:18 2014 (r260707) +++ vendor-sys/illumos/dist/uts/common/dtrace/fasttrap.c Thu Jan 16 12:53:01 2014 (r260708) @@ -25,7 +25,7 @@ */ /* - * Copyright (c) 2011, Joyent, Inc. All rights reserved. + * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ #include @@ -1936,8 +1936,7 @@ fasttrap_ioctl(dev_t dev, int cmd, intpt 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))) @@ -1967,18 +1966,16 @@ fasttrap_ioctl(dev_t dev, int cmd, intpt * 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; } if (!PRIV_POLICY_CHOICE(cr, PRIV_ALL, B_FALSE)) {