Print this page
2915 DTrace in a zone should see "cpu", "curpsinfo", et al
2916 DTrace in a zone should be able to access fds[]
2917 DTrace in a zone should have limited provider access
Reviewed by: Joshua M. Clulow <josh@sysmgr.org>
Reviewed by: Adam Leventhal <ahl@delphix.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/sys/dtrace.h
          +++ new/usr/src/uts/common/sys/dtrace.h
↓ open down ↓ 17 lines elided ↑ open up ↑
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  24   24   * Use is subject to license terms.
  25   25   */
  26   26  
  27   27  /*
  28      - * Copyright (c) 2011, Joyent, Inc. All rights reserved.
       28 + * Copyright (c) 2012, Joyent, Inc. All rights reserved.
  29   29   * Copyright (c) 2012 by Delphix. All rights reserved.
  30   30   */
  31   31  
  32   32  #ifndef _SYS_DTRACE_H
  33   33  #define _SYS_DTRACE_H
  34   34  
  35   35  #ifdef  __cplusplus
  36   36  extern "C" {
  37   37  #endif
  38   38  
↓ open down ↓ 242 lines elided ↑ open up ↑
 281  281  #define DIF_SUBR_HTONL                  36
 282  282  #define DIF_SUBR_HTONLL                 37
 283  283  #define DIF_SUBR_NTOHS                  38
 284  284  #define DIF_SUBR_NTOHL                  39
 285  285  #define DIF_SUBR_NTOHLL                 40
 286  286  #define DIF_SUBR_INET_NTOP              41
 287  287  #define DIF_SUBR_INET_NTOA              42
 288  288  #define DIF_SUBR_INET_NTOA6             43
 289  289  #define DIF_SUBR_TOUPPER                44
 290  290  #define DIF_SUBR_TOLOWER                45
      291 +#define DIF_SUBR_GETF                   46
 291  292  
 292      -#define DIF_SUBR_MAX                    45      /* max subroutine value */
      293 +#define DIF_SUBR_MAX                    46      /* max subroutine value */
 293  294  
 294  295  typedef uint32_t dif_instr_t;
 295  296  
 296  297  #define DIF_INSTR_OP(i)                 (((i) >> 24) & 0xff)
 297  298  #define DIF_INSTR_R1(i)                 (((i) >> 16) & 0xff)
 298  299  #define DIF_INSTR_R2(i)                 (((i) >>  8) & 0xff)
 299  300  #define DIF_INSTR_RD(i)                 ((i) & 0xff)
 300  301  #define DIF_INSTR_RS(i)                 ((i) & 0xff)
 301  302  #define DIF_INSTR_LABEL(i)              ((i) & 0xffffff)
 302  303  #define DIF_INSTR_VAR(i)                (((i) >>  8) & 0xffff)
↓ open down ↓ 1339 lines elided ↑ open up ↑
1642 1643   *   second argument is the identifier of the current probe.  The third
1643 1644   *   argument is the probe argument as passed to dtrace_probe_create().  This
1644 1645   *   entry point must not be left NULL for providers whose probes allow for
1645 1646   *   mixed mode tracing, that is to say those unanchored probes that can fire
1646 1647   *   during kernel- or user-mode execution.
1647 1648   *
1648 1649   * 1.10.3  Return value
1649 1650   *
1650 1651   *   A bitwise OR that encapsulates both the mode (either DTRACE_MODE_KERNEL
1651 1652   *   or DTRACE_MODE_USER) and the policy when the privilege of the enabling
1652      - *   is insufficient for that mode (either DTRACE_MODE_NOPRIV_DROP or
1653      - *   DTRACE_MODE_NOPRIV_RESTRICT).  If the policy is DTRACE_MODE_NOPRIV_DROP,
1654      - *   insufficient privilege will result in the probe firing being silently
1655      - *   ignored for the enabling; if the policy is DTRACE_NODE_NOPRIV_RESTRICT,
1656      - *   insufficient privilege will not prevent probe processing for the
1657      - *   enabling, but restrictions will be in place that induce a UPRIV fault
1658      - *   upon attempt to examine probe arguments or current process state.
     1653 + *   is insufficient for that mode (a combination of DTRACE_MODE_NOPRIV_DROP,
     1654 + *   DTRACE_MODE_NOPRIV_RESTRICT, and DTRACE_MODE_LIMITEDPRIV_RESTRICT).  If
     1655 + *   DTRACE_MODE_NOPRIV_DROP bit is set, insufficient privilege will result
     1656 + *   in the probe firing being silently ignored for the enabling; if the
     1657 + *   DTRACE_NODE_NOPRIV_RESTRICT bit is set, insufficient privilege will not
     1658 + *   prevent probe processing for the enabling, but restrictions will be in
     1659 + *   place that induce a UPRIV fault upon attempt to examine probe arguments
     1660 + *   or current process state.  If the DTRACE_MODE_LIMITEDPRIV_RESTRICT bit
     1661 + *   is set, similar restrictions will be placed upon operation if the
     1662 + *   privilege is sufficient to process the enabling, but does not otherwise
     1663 + *   entitle the enabling to all zones.  The DTRACE_MODE_NOPRIV_DROP and
     1664 + *   DTRACE_MODE_NOPRIV_RESTRICT are mutually exclusive (and one of these
     1665 + *   two policies must be specified), but either may be combined (or not)
     1666 + *   with DTRACE_MODE_LIMITEDPRIV_RESTRICT.
1659 1667   *
1660 1668   * 1.10.4  Caller's context
1661 1669   *
1662 1670   *   This is called from within dtrace_probe() meaning that interrupts
1663 1671   *   are disabled. No locks should be taken within this entry point.
1664 1672   *
1665 1673   * 1.11 void dtps_destroy(void *arg, dtrace_id_t id, void *parg)
1666 1674   *
1667 1675   * 1.11.1 Overview
1668 1676   *
↓ open down ↓ 378 lines elided ↑ open up ↑
2047 2055          uint64_t (*dtps_getargval)(void *arg, dtrace_id_t id, void *parg,
2048 2056              int argno, int aframes);
2049 2057          int (*dtps_mode)(void *arg, dtrace_id_t id, void *parg);
2050 2058          void (*dtps_destroy)(void *arg, dtrace_id_t id, void *parg);
2051 2059  } dtrace_pops_t;
2052 2060  
2053 2061  #define DTRACE_MODE_KERNEL                      0x01
2054 2062  #define DTRACE_MODE_USER                        0x02
2055 2063  #define DTRACE_MODE_NOPRIV_DROP                 0x10
2056 2064  #define DTRACE_MODE_NOPRIV_RESTRICT             0x20
     2065 +#define DTRACE_MODE_LIMITEDPRIV_RESTRICT        0x40
2057 2066  
2058 2067  typedef uintptr_t       dtrace_provider_id_t;
2059 2068  
2060 2069  extern int dtrace_register(const char *, const dtrace_pattr_t *, uint32_t,
2061 2070      cred_t *, const dtrace_pops_t *, void *, dtrace_provider_id_t *);
2062 2071  extern int dtrace_unregister(dtrace_provider_id_t);
2063 2072  extern int dtrace_condense(dtrace_provider_id_t);
2064 2073  extern void dtrace_invalidate(dtrace_provider_id_t);
2065 2074  extern dtrace_id_t dtrace_probe_lookup(dtrace_provider_id_t, const char *,
2066 2075      const char *, const char *);
↓ open down ↓ 194 lines elided ↑ open up ↑
2261 2270  extern void dtrace_membar_producer(void);
2262 2271  extern void dtrace_membar_consumer(void);
2263 2272  
2264 2273  extern void (*dtrace_cpu_init)(processorid_t);
2265 2274  extern void (*dtrace_modload)(struct modctl *);
2266 2275  extern void (*dtrace_modunload)(struct modctl *);
2267 2276  extern void (*dtrace_helpers_cleanup)();
2268 2277  extern void (*dtrace_helpers_fork)(proc_t *parent, proc_t *child);
2269 2278  extern void (*dtrace_cpustart_init)();
2270 2279  extern void (*dtrace_cpustart_fini)();
     2280 +extern void (*dtrace_closef)();
2271 2281  
2272 2282  extern void (*dtrace_debugger_init)();
2273 2283  extern void (*dtrace_debugger_fini)();
2274 2284  extern dtrace_cacheid_t dtrace_predcache_id;
2275 2285  
2276 2286  extern hrtime_t dtrace_gethrtime(void);
2277 2287  extern void dtrace_sync(void);
2278 2288  extern void dtrace_toxic_ranges(void (*)(uintptr_t, uintptr_t));
2279 2289  extern void dtrace_xcall(processorid_t, dtrace_xcall_t, void *);
2280 2290  extern void dtrace_vpanic(const char *, __va_list);
↓ open down ↓ 48 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX