Print this page
8560 Reference leak on ipsec_action_t
Reviewed by: Norm Jacobs <naj@snapcon.com>
Reviewed by: Andy Fiddaman <omnios@citrus-it.net>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/inet/ip/spd.c
          +++ new/usr/src/uts/common/inet/ip/spd.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 2010 Sun Microsystems, Inc.  All rights reserved.
  23   23   * Use is subject to license terms.
  24   24   * Copyright (c) 2012 Nexenta Systems, Inc. All rights reserved.
  25   25   * Copyright (c) 2016 by Delphix. All rights reserved.
  26      - * Copyright (c) 2017, Joyent, Inc.
       26 + * Copyright (c) 2018, Joyent, Inc.
  27   27   */
  28   28  
  29   29  /*
  30   30   * IPsec Security Policy Database.
  31   31   *
  32   32   * This module maintains the SPD and provides routines used by ip and ip6
  33   33   * to apply IPsec policy to inbound and outbound datagrams.
  34   34   */
  35   35  
  36   36  #include <sys/types.h>
↓ open down ↓ 4079 lines elided ↑ open up ↑
4116 4116                  return;
4117 4117  
4118 4118          if (ira->ira_ipsec_ah_sa != NULL) {
4119 4119                  IPSA_REFRELE(ira->ira_ipsec_ah_sa);
4120 4120                  ira->ira_ipsec_ah_sa = NULL;
4121 4121          }
4122 4122          if (ira->ira_ipsec_esp_sa != NULL) {
4123 4123                  IPSA_REFRELE(ira->ira_ipsec_esp_sa);
4124 4124                  ira->ira_ipsec_esp_sa = NULL;
4125 4125          }
     4126 +        if (ira->ira_ipsec_action != NULL) {
     4127 +                IPACT_REFRELE(ira->ira_ipsec_action);
     4128 +                ira->ira_ipsec_action = NULL;
     4129 +        }
     4130 +
4126 4131          ira->ira_flags &= ~IRAF_IPSEC_SECURE;
4127 4132  }
4128 4133  
4129 4134  /*
4130 4135   * This is called from ire_send_local when a packet
4131 4136   * is looped back. We setup the ip_recv_attr_t "borrowing" the references
4132 4137   * held by the callers.
4133 4138   * Note that we don't do any IPsec but we carry the actions and IPSEC flags
4134 4139   * across so that the fanout policy checks see that IPsec was applied.
4135 4140   *
↓ open down ↓ 2777 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX