Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 Jan 2014 12:53:01 +0000 (UTC)
From:      Andriy Gapon <avg@FreeBSD.org>
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
Message-ID:  <201401161253.s0GCr1h9095594@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 <sys/atomic.h>
@@ -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)) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201401161253.s0GCr1h9095594>