Print this page
2917 DTrace in a zone should have limited provider access

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   */
  30   30  
  31   31  #ifndef _SYS_DTRACE_H
  32   32  #define _SYS_DTRACE_H
  33   33  
  34   34  #ifdef  __cplusplus
  35   35  extern "C" {
  36   36  #endif
  37   37  
  38   38  /*
↓ open down ↓ 1579 lines elided ↑ open up ↑
1618 1618   *   second argument is the identifier of the current probe.  The third
1619 1619   *   argument is the probe argument as passed to dtrace_probe_create().  This
1620 1620   *   entry point must not be left NULL for providers whose probes allow for
1621 1621   *   mixed mode tracing, that is to say those unanchored probes that can fire
1622 1622   *   during kernel- or user-mode execution.
1623 1623   *
1624 1624   * 1.10.3  Return value
1625 1625   *
1626 1626   *   A bitwise OR that encapsulates both the mode (either DTRACE_MODE_KERNEL
1627 1627   *   or DTRACE_MODE_USER) and the policy when the privilege of the enabling
1628      - *   is insufficient for that mode (either DTRACE_MODE_NOPRIV_DROP or
1629      - *   DTRACE_MODE_NOPRIV_RESTRICT).  If the policy is DTRACE_MODE_NOPRIV_DROP,
1630      - *   insufficient privilege will result in the probe firing being silently
1631      - *   ignored for the enabling; if the policy is DTRACE_NODE_NOPRIV_RESTRICT,
1632      - *   insufficient privilege will not prevent probe processing for the
1633      - *   enabling, but restrictions will be in place that induce a UPRIV fault
1634      - *   upon attempt to examine probe arguments or current process state.
     1628 + *   is insufficient for that mode (a combination of DTRACE_MODE_NOPRIV_DROP,
     1629 + *   DTRACE_MODE_NOPRIV_RESTRICT, and DTRACE_MODE_LIMITEDPRIV_RESTRICT).  If
     1630 + *   DTRACE_MODE_NOPRIV_DROP bit is set, insufficient privilege will result
     1631 + *   in the probe firing being silently ignored for the enabling; if the
     1632 + *   DTRACE_NODE_NOPRIV_RESTRICT bit is set, insufficient privilege will not
     1633 + *   prevent probe processing for the enabling, but restrictions will be in
     1634 + *   place that induce a UPRIV fault upon attempt to examine probe arguments
     1635 + *   or current process state.  If the DTRACE_MODE_LIMITEDPRIV_RESTRICT bit
     1636 + *   is set, similar restrictions will be placed upon operation if the
     1637 + *   privilege is sufficient to process the enabling, but does not otherwise
     1638 + *   entitle the enabling to all zones.  The DTRACE_MODE_NOPRIV_DROP and
     1639 + *   DTRACE_MODE_NOPRIV_RESTRICT are mutually exclusive (and one of these
     1640 + *   two policies must be specified), but either may be combined (or not)
     1641 + *   with DTRACE_MODE_LIMITEDPRIV_RESTRICT.
1635 1642   *
1636 1643   * 1.10.4  Caller's context
1637 1644   *
1638 1645   *   This is called from within dtrace_probe() meaning that interrupts
1639 1646   *   are disabled. No locks should be taken within this entry point.
1640 1647   *
1641 1648   * 1.11 void dtps_destroy(void *arg, dtrace_id_t id, void *parg)
1642 1649   *
1643 1650   * 1.11.1 Overview
1644 1651   *
↓ open down ↓ 378 lines elided ↑ open up ↑
2023 2030          uint64_t (*dtps_getargval)(void *arg, dtrace_id_t id, void *parg,
2024 2031              int argno, int aframes);
2025 2032          int (*dtps_mode)(void *arg, dtrace_id_t id, void *parg);
2026 2033          void (*dtps_destroy)(void *arg, dtrace_id_t id, void *parg);
2027 2034  } dtrace_pops_t;
2028 2035  
2029 2036  #define DTRACE_MODE_KERNEL                      0x01
2030 2037  #define DTRACE_MODE_USER                        0x02
2031 2038  #define DTRACE_MODE_NOPRIV_DROP                 0x10
2032 2039  #define DTRACE_MODE_NOPRIV_RESTRICT             0x20
     2040 +#define DTRACE_MODE_LIMITEDPRIV_RESTRICT        0x40
2033 2041  
2034 2042  typedef uintptr_t       dtrace_provider_id_t;
2035 2043  
2036 2044  extern int dtrace_register(const char *, const dtrace_pattr_t *, uint32_t,
2037 2045      cred_t *, const dtrace_pops_t *, void *, dtrace_provider_id_t *);
2038 2046  extern int dtrace_unregister(dtrace_provider_id_t);
2039 2047  extern int dtrace_condense(dtrace_provider_id_t);
2040 2048  extern void dtrace_invalidate(dtrace_provider_id_t);
2041 2049  extern dtrace_id_t dtrace_probe_lookup(dtrace_provider_id_t, const char *,
2042 2050      const char *, const char *);
↓ open down ↓ 263 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX