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)) {
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to