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>
  35   34  
  36   35  #include <sys/vmparam.h>
  37   36  #include <sys/machparam.h>
  38   37  
  39   38  /*
  40   39   * Process-based resource controls
  41   40   *   The structure of the kernel leaves us no particular place where the process
  42   41   *   abstraction can be declared--it is intertwined with the growth of the Unix
  43   42   *   kernel.  Accordingly, we place all of the resource control logic associated
  44   43   *   with processes, both existing and future, in this file.
↓ open down ↓ 13 lines elided ↑ open up ↑
  58   57          SIGXCPU,                                /* RLIMIT_CPU   */
  59   58          SIGXFSZ,                                /* RLIMIT_FSIZE */
  60   59          0, 0, 0, 0, 0                           /* remainder do not signal */
  61   60  };
  62   61  
  63   62  rctl_hndl_t rc_process_msgmnb;
  64   63  rctl_hndl_t rc_process_msgtql;
  65   64  rctl_hndl_t rc_process_semmsl;
  66   65  rctl_hndl_t rc_process_semopm;
  67   66  rctl_hndl_t rc_process_portev;
       67 +rctl_hndl_t rc_process_sigqueue;
  68   68  
  69   69  /*
  70   70   * process.max-cpu-time / RLIMIT_CPU
  71   71   */
  72   72  /*ARGSUSED*/
  73   73  static int
  74   74  proc_cpu_time_test(struct rctl *rctl, struct proc *p, rctl_entity_p_t *e,
  75   75      rctl_val_t *rval, rctl_qty_t inc, uint_t flags)
  76   76  {
  77   77          return (inc >= rval->rcv_value);
↓ open down ↓ 203 lines elided ↑ open up ↑
 281  281  
 282  282  /*
 283  283   * void rctlproc_init()
 284  284   *
 285  285   * Overview
 286  286   *   Register the various resource controls associated with process entities.
 287  287   *   The historical rlim_infinity_map and rlim_infinity32_map are now encoded
 288  288   *   here as the native and ILP32 infinite values for each resource control.
 289  289   */
 290  290  void
 291      -rctlproc_init()
      291 +rctlproc_init(void)
 292  292  {
 293  293          rctl_set_t *set;
 294  294          rctl_alloc_gp_t *gp;
 295  295          rctl_entity_p_t e;
 296  296  
 297  297          rctlproc_legacy[RLIMIT_CPU] = rctl_register("process.max-cpu-time",
 298  298              RCENTITY_PROCESS, RCTL_GLOBAL_LOWERABLE | RCTL_GLOBAL_DENY_NEVER |
 299  299              RCTL_GLOBAL_CPU_TIME | RCTL_GLOBAL_INFINITE | RCTL_GLOBAL_SECONDS,
 300  300              UINT64_MAX, UINT64_MAX, &proc_cpu_time_ops);
 301  301          rctlproc_legacy[RLIMIT_FSIZE] = rctl_register("process.max-file-size",
↓ open down ↓ 59 lines elided ↑ open up ↑
 361  361              UINT_MAX, UINT_MAX, &rctl_absolute_ops);
 362  362          rctl_add_legacy_limit("process.max-msg-messages", "msgsys",
 363  363              "msginfo_msgtql", 8192, UINT_MAX);
 364  364  
 365  365          rc_process_portev = rctl_register("process.max-port-events",
 366  366              RCENTITY_PROCESS, RCTL_GLOBAL_DENY_ALWAYS | RCTL_GLOBAL_COUNT,
 367  367              PORT_MAX_EVENTS, PORT_MAX_EVENTS, &rctl_absolute_ops);
 368  368          rctl_add_default_limit("process.max-port-events", PORT_DEFAULT_EVENTS,
 369  369              RCPRIV_PRIVILEGED, RCTL_LOCAL_DENY);
 370  370  
      371 +        rc_process_sigqueue = rctl_register("process.max-sigqueue-size",
      372 +            RCENTITY_PROCESS, RCTL_GLOBAL_LOWERABLE | RCTL_GLOBAL_DENY_ALWAYS |
      373 +            RCTL_GLOBAL_COUNT, _SIGQUEUE_SIZE_MAX, _SIGQUEUE_SIZE_MAX,
      374 +            &rctl_absolute_ops);
      375 +        rctl_add_default_limit("process.max-sigqueue-size",
      376 +            _SIGQUEUE_SIZE_BASIC, RCPRIV_BASIC, RCTL_LOCAL_DENY);
      377 +        rctl_add_default_limit("process.max-sigqueue-size",
      378 +            _SIGQUEUE_SIZE_PRIVILEGED, RCPRIV_PRIVILEGED, RCTL_LOCAL_DENY);
      379 +
 371  380          /*
 372  381           * Place minimal set of controls on "sched" process for inheritance by
 373  382           * processes created via newproc().
 374  383           */
 375  384          set = rctl_set_create();
 376  385          gp = rctl_set_init_prealloc(RCENTITY_PROCESS);
 377  386          mutex_enter(&curproc->p_lock);
 378  387          e.rcep_p.proc = curproc;
 379  388          e.rcep_t = RCENTITY_PROCESS;
 380  389          curproc->p_rctls = rctl_set_init(RCENTITY_PROCESS, curproc, &e,
 381  390              set, gp);
 382  391          mutex_exit(&curproc->p_lock);
 383  392          rctl_prealloc_destroy(gp);
 384  393  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX