Print this page
8927 sadb_x_kmc_t's KM cookie should be 64-bits (fix improper upstream)

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/inet/ip/sadb.c
          +++ new/usr/src/uts/common/inet/ip/sadb.c
↓ open down ↓ 2322 lines elided ↑ open up ↑
2323 2323                  sq->sidtype = sq->srcid->sadb_ident_type;
2324 2324                  *mfpp++ = sadb_match_srcid;
2325 2325          }
2326 2326  
2327 2327          sq->kmcext = (sadb_x_kmc_t *)ksi->ks_in_extv[SADB_X_EXT_KM_COOKIE];
2328 2328          sq->kmc = 0;
2329 2329          sq->kmp = 0;
2330 2330  
2331 2331          if ((match & IPSA_Q_KMC) && (sq->kmcext)) {
2332 2332                  sq->kmp = sq->kmcext->sadb_x_kmc_proto;
2333      -                /* Be liberal in what we receive.  Special-case IKEv1. */
     2333 +                /*
     2334 +                 * Be liberal in what we receive.  Special-case the IKEv1
     2335 +                 * cookie, which closed-source in.iked assumes is 32 bits.
     2336 +                 * Now that we store all 64 bits, we should pre-zero the
     2337 +                 * reserved field on behalf of closed-source in.iked.
     2338 +                 */
2334 2339                  if (sq->kmp == SADB_X_KMP_IKE) {
2335 2340                          /* Just in case in.iked is misbehaving... */
2336 2341                          sq->kmcext->sadb_x_kmc_reserved = 0;
2337 2342                  }
2338 2343                  sq->kmc = sq->kmcext->sadb_x_kmc_cookie64;
2339 2344                  *mfpp++ = sadb_match_kmc;
2340 2345          }
2341 2346  
2342 2347          if (match & (IPSA_Q_INBOUND|IPSA_Q_OUTBOUND)) {
2343 2348                  if (sq->af == AF_INET6)
↓ open down ↓ 786 lines elided ↑ open up ↑
3130 3135           */
3131 3136          if (ksi->ks_in_srctype != KS_IN_ADDR_UNSPEC)
3132 3137                  newbie->ipsa_replay_wsize = assoc->sadb_sa_replay;
3133 3138          else
3134 3139                  newbie->ipsa_replay_wsize = 0;
3135 3140  
3136 3141          newbie->ipsa_addtime = gethrestime_sec();
3137 3142  
3138 3143          if (kmcext != NULL) {
3139 3144                  newbie->ipsa_kmp = kmcext->sadb_x_kmc_proto;
3140      -                /* Be liberal in what we receive.  Special-case IKEv1. */
     3145 +                /*
     3146 +                 * Be liberal in what we receive.  Special-case the IKEv1
     3147 +                 * cookie, which closed-source in.iked assumes is 32 bits.
     3148 +                 * Now that we store all 64 bits, we should pre-zero the
     3149 +                 * reserved field on behalf of closed-source in.iked.
     3150 +                 */
3141 3151                  if (newbie->ipsa_kmp == SADB_X_KMP_IKE) {
3142 3152                          /* Just in case in.iked is misbehaving... */
3143 3153                          kmcext->sadb_x_kmc_reserved = 0;
3144 3154                  }
3145 3155                  newbie->ipsa_kmc = kmcext->sadb_x_kmc_cookie64;
3146 3156          }
3147 3157  
3148 3158          /*
3149 3159           * XXX CURRENT lifetime checks MAY BE needed for an UPDATE.
3150 3160           * The spec says that one can update current lifetimes, but
↓ open down ↓ 4951 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX