Print this page
3830 SIGQUEUE_MAX's limit of 32 is too low

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/os/rctl_proc.c
          +++ new/usr/src/uts/common/os/rctl_proc.c
↓ open down ↓ 15 lines elided ↑ open up ↑
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*
  22   22   * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
  23   23   * Use is subject to license terms.
  24   24   */
  25   25  
  26      -#pragma ident   "%Z%%M% %I%     %E% SMI"
  27      -
  28   26  #include <sys/types.h>
  29   27  #include <sys/cmn_err.h>
  30   28  #include <sys/sysmacros.h>
  31   29  #include <sys/proc.h>
  32   30  #include <sys/rctl.h>
  33   31  #include <sys/rctl_impl.h>
  34   32  #include <sys/port_kernel.h>
       33 +#include <sys/signal.h>
       34 +#include <sys/var.h>
  35   35  
  36   36  #include <sys/vmparam.h>
  37   37  #include <sys/machparam.h>
  38   38  
  39   39  /*
  40   40   * Process-based resource controls
  41   41   *   The structure of the kernel leaves us no particular place where the process
  42   42   *   abstraction can be declared--it is intertwined with the growth of the Unix
  43   43   *   kernel.  Accordingly, we place all of the resource control logic associated
  44   44   *   with processes, both existing and future, in this file.
↓ open down ↓ 13 lines elided ↑ open up ↑
  58   58          SIGXCPU,                                /* RLIMIT_CPU   */
  59   59          SIGXFSZ,                                /* RLIMIT_FSIZE */
  60   60          0, 0, 0, 0, 0                           /* remainder do not signal */
  61   61  };
  62   62  
  63   63  rctl_hndl_t rc_process_msgmnb;
  64   64  rctl_hndl_t rc_process_msgtql;
  65   65  rctl_hndl_t rc_process_semmsl;
  66   66  rctl_hndl_t rc_process_semopm;
  67   67  rctl_hndl_t rc_process_portev;
       68 +rctl_hndl_t rc_process_sigqueue;
  68   69  
  69   70  /*
  70   71   * process.max-cpu-time / RLIMIT_CPU
  71   72   */
  72   73  /*ARGSUSED*/
  73   74  static int
  74   75  proc_cpu_time_test(struct rctl *rctl, struct proc *p, rctl_entity_p_t *e,
  75   76      rctl_val_t *rval, rctl_qty_t inc, uint_t flags)
  76   77  {
  77   78          return (inc >= rval->rcv_value);
↓ open down ↓ 203 lines elided ↑ open up ↑
 281  282  
 282  283  /*
 283  284   * void rctlproc_init()
 284  285   *
 285  286   * Overview
 286  287   *   Register the various resource controls associated with process entities.
 287  288   *   The historical rlim_infinity_map and rlim_infinity32_map are now encoded
 288  289   *   here as the native and ILP32 infinite values for each resource control.
 289  290   */
 290  291  void
 291      -rctlproc_init()
      292 +rctlproc_init(void)
 292  293  {
 293  294          rctl_set_t *set;
 294  295          rctl_alloc_gp_t *gp;
 295  296          rctl_entity_p_t e;
 296  297  
 297  298          rctlproc_legacy[RLIMIT_CPU] = rctl_register("process.max-cpu-time",
 298  299              RCENTITY_PROCESS, RCTL_GLOBAL_LOWERABLE | RCTL_GLOBAL_DENY_NEVER |
 299  300              RCTL_GLOBAL_CPU_TIME | RCTL_GLOBAL_INFINITE | RCTL_GLOBAL_SECONDS,
 300  301              UINT64_MAX, UINT64_MAX, &proc_cpu_time_ops);
 301  302          rctlproc_legacy[RLIMIT_FSIZE] = rctl_register("process.max-file-size",
↓ open down ↓ 59 lines elided ↑ open up ↑
 361  362              UINT_MAX, UINT_MAX, &rctl_absolute_ops);
 362  363          rctl_add_legacy_limit("process.max-msg-messages", "msgsys",
 363  364              "msginfo_msgtql", 8192, UINT_MAX);
 364  365  
 365  366          rc_process_portev = rctl_register("process.max-port-events",
 366  367              RCENTITY_PROCESS, RCTL_GLOBAL_DENY_ALWAYS | RCTL_GLOBAL_COUNT,
 367  368              PORT_MAX_EVENTS, PORT_MAX_EVENTS, &rctl_absolute_ops);
 368  369          rctl_add_default_limit("process.max-port-events", PORT_DEFAULT_EVENTS,
 369  370              RCPRIV_PRIVILEGED, RCTL_LOCAL_DENY);
 370  371  
      372 +        rc_process_sigqueue = rctl_register("process.max-sigqueue-size",
      373 +            RCENTITY_PROCESS, RCTL_GLOBAL_LOWERABLE | RCTL_GLOBAL_DENY_ALWAYS |
      374 +            RCTL_GLOBAL_COUNT, v.v_maxup, v.v_maxup,
      375 +            &rctl_absolute_ops);
      376 +        rctl_add_default_limit("process.max-sigqueue-size",
      377 +            _SIGQUEUE_SIZE_BASIC, RCPRIV_BASIC, RCTL_LOCAL_DENY);
      378 +        rctl_add_default_limit("process.max-sigqueue-size",
      379 +            _SIGQUEUE_SIZE_PRIVILEGED, RCPRIV_PRIVILEGED, RCTL_LOCAL_DENY);
      380 +
 371  381          /*
 372  382           * Place minimal set of controls on "sched" process for inheritance by
 373  383           * processes created via newproc().
 374  384           */
 375  385          set = rctl_set_create();
 376  386          gp = rctl_set_init_prealloc(RCENTITY_PROCESS);
 377  387          mutex_enter(&curproc->p_lock);
 378  388          e.rcep_p.proc = curproc;
 379  389          e.rcep_t = RCENTITY_PROCESS;
 380  390          curproc->p_rctls = rctl_set_init(RCENTITY_PROCESS, curproc, &e,
 381  391              set, gp);
 382  392          mutex_exit(&curproc->p_lock);
 383  393          rctl_prealloc_destroy(gp);
 384  394  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX