Print this page
3354 kernel crash in rpcsec_gss after using gsscred
Reviewed by: Toomas Soome <tsoome@me.com>
Reviewed by: Carlos Neira <cneirabustos@gmail.com>
Approved by: Robert Mustacchi <rm@joyent.com>
NEX-4123 xdrmblk_getpos() is unreliable
Reviewed by: Josef 'Jeff' Sipek <josef.sipek@nexenta.com>
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
re #13613 rb4516 Tunables needs volatile keyword

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/rpc/svc_cots.c
          +++ new/usr/src/uts/common/rpc/svc_cots.c
↓ open down ↓ 13 lines elided ↑ open up ↑
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  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  /*
  23   23   * Copyright 2015 Nexenta Systems, Inc.  All rights reserved.
  24      - *  Copyright (c) 1993, 2010, Oracle and/or its affiliates. All rights reserved.
       24 + * Copyright (c) 1993, 2010, Oracle and/or its affiliates. All rights reserved.
  25   25   * Copyright (c) 2012 by Delphix. All rights reserved.
       26 + * Copyright 2012 Marcel Telka <marcel@telka.sk>
       27 + * Copyright 2018 OmniOS Community Edition (OmniOSce) Association.
  26   28   */
  27   29  
  28   30  /*      Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T     */
  29      -/*        All Rights Reserved   */
       31 +/*      All Rights Reserved     */
  30   32  
  31   33  /*
  32   34   * Portions of this source code were derived from Berkeley 4.3 BSD
  33   35   * under license from the Regents of the University of California.
  34   36   */
  35   37  
  36   38  /*
  37   39   * svc_cots.c
  38   40   * Server side for connection-oriented RPC in the kernel.
  39   41   *
↓ open down ↓ 57 lines elided ↑ open up ↑
  97   99          svc_cots_ksend,         /* Send reply */
  98  100          svc_cots_kfreeargs,     /* Free argument data space */
  99  101          svc_cots_kdestroy,      /* Destroy transport handle */
 100  102          svc_cots_kdup,          /* Check entry in dup req cache */
 101  103          svc_cots_kdupdone,      /* Mark entry in dup req cache as done */
 102  104          svc_cots_kgetres,       /* Get pointer to response buffer */
 103  105          svc_cots_kfreeres,      /* Destroy pre-serialized response header */
 104  106          svc_cots_kclone_destroy, /* Destroy a clone xprt */
 105  107          svc_cots_kstart,        /* Tell `ready-to-receive' to rpcmod */
 106  108          NULL,                   /* Transport specific clone xprt */
 107      -        svc_cots_ktattrs        /* Transport Attributes */
      109 +        svc_cots_ktattrs,       /* Transport Attributes */
      110 +        mir_svc_hold,           /* Increment transport reference count */
      111 +        mir_svc_release         /* Decrement transport reference count */
 108  112  };
 109  113  
 110  114  /*
 111  115   * Master transport private data.
 112  116   * Kept in xprt->xp_p2.
 113  117   */
 114  118  struct cots_master_data {
 115  119          char    *cmd_src_addr;  /* client's address */
 116  120          int     cmd_xprt_started; /* flag for clone routine to call */
 117  121                                  /* rpcmod's start routine. */
↓ open down ↓ 602 lines elided ↑ open up ↑
 720  724   * This should be appropriately scaled to MAXDUPREQS.  To produce as less as
 721  725   * possible collisions it is suggested to set this to a prime.
 722  726   */
 723  727  #define DRHASHSZ        2053
 724  728  
 725  729  #define XIDHASH(xid)    ((xid) % DRHASHSZ)
 726  730  #define DRHASH(dr)      XIDHASH((dr)->dr_xid)
 727  731  #define REQTOXID(req)   ((req)->rq_xprt->xp_xid)
 728  732  
 729  733  static int      cotsndupreqs = 0;
 730      -int     cotsmaxdupreqs = MAXDUPREQS;
      734 +volatile int    cotsmaxdupreqs = MAXDUPREQS;
 731  735  static kmutex_t cotsdupreq_lock;
 732  736  static struct dupreq *cotsdrhashtbl[DRHASHSZ];
 733  737  static int      cotsdrhashstat[DRHASHSZ];
 734  738  
 735  739  static void unhash(struct dupreq *);
 736  740  
 737  741  /*
 738  742   * cotsdrmru points to the head of a circular linked list in lru order.
 739  743   * cotsdrmru->dr_next == drlru
 740  744   */
↓ open down ↓ 225 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX