diff options
author | Erik Nordmark <Erik.Nordmark@Sun.COM> | 2010-03-03 23:02:28 -0800 |
---|---|---|
committer | Erik Nordmark <Erik.Nordmark@Sun.COM> | 2010-03-03 23:02:28 -0800 |
commit | be4c8f742bc67a43d01e3ea82a814b7d6503dbfd (patch) | |
tree | c304def0e46245cdb85a6f332628161d30b4c2fe /usr/src | |
parent | 3ece6d0336a50c94561d17698f9158f5fe8d853d (diff) | |
download | illumos-gate-be4c8f742bc67a43d01e3ea82a814b7d6503dbfd.tar.gz |
6929890 ixa_cred/ira_cred cleanup
Diffstat (limited to 'usr/src')
-rw-r--r-- | usr/src/uts/common/inet/ip/conn_opt.c | 1 | ||||
-rw-r--r-- | usr/src/uts/common/inet/ip/icmp.c | 21 | ||||
-rw-r--r-- | usr/src/uts/common/inet/ip/ip.c | 1 | ||||
-rw-r--r-- | usr/src/uts/common/inet/ip/ip_attr.c | 8 | ||||
-rw-r--r-- | usr/src/uts/common/inet/ip/rts.c | 3 | ||||
-rw-r--r-- | usr/src/uts/common/inet/iptun/iptun.c | 1 | ||||
-rw-r--r-- | usr/src/uts/common/inet/sctp/sctp_bind.c | 3 | ||||
-rw-r--r-- | usr/src/uts/common/inet/sctp/sctp_conn.c | 3 | ||||
-rw-r--r-- | usr/src/uts/common/inet/sctp/sctp_ioc.c | 3 | ||||
-rw-r--r-- | usr/src/uts/common/inet/tcp/tcp.c | 2 | ||||
-rw-r--r-- | usr/src/uts/common/inet/tcp/tcp_tpi.c | 1 | ||||
-rw-r--r-- | usr/src/uts/common/inet/udp/udp.c | 16 |
12 files changed, 57 insertions, 6 deletions
diff --git a/usr/src/uts/common/inet/ip/conn_opt.c b/usr/src/uts/common/inet/ip/conn_opt.c index c7a53d793e..f01d3db236 100644 --- a/usr/src/uts/common/inet/ip/conn_opt.c +++ b/usr/src/uts/common/inet/ip/conn_opt.c @@ -2889,6 +2889,7 @@ conn_inherit_parent(conn_t *lconnp, conn_t *econnp) * Cache things in the ixa without any refhold. * Listener might not have set up ixa_cred */ + ASSERT(!(econnp->conn_ixa->ixa_free_flags & IXA_FREE_CRED)); econnp->conn_ixa->ixa_cred = econnp->conn_cred; econnp->conn_ixa->ixa_cpid = econnp->conn_cpid; if (is_system_labeled()) diff --git a/usr/src/uts/common/inet/ip/icmp.c b/usr/src/uts/common/inet/ip/icmp.c index 2b05d02458..e2eed17eb2 100644 --- a/usr/src/uts/common/inet/ip/icmp.c +++ b/usr/src/uts/common/inet/ip/icmp.c @@ -806,6 +806,7 @@ rawip_do_connect(conn_t *connp, const struct sockaddr *sa, socklen_t len, connp->conn_cred = cr; } connp->conn_cpid = pid; + ASSERT(!(ixa->ixa_free_flags & IXA_FREE_CRED)); ixa->ixa_cred = cr; ixa->ixa_cpid = pid; if (is_system_labeled()) { @@ -1722,6 +1723,7 @@ rawip_do_open(int family, cred_t *credp, int *err, int flags) connp->conn_cpid = curproc->p_pid; connp->conn_open_time = ddi_get_lbolt64(); /* Cache things in ixa without an extra refhold */ + ASSERT(!(connp->conn_ixa->ixa_free_flags & IXA_FREE_CRED)); connp->conn_ixa->ixa_cred = connp->conn_cred; connp->conn_ixa->ixa_cpid = connp->conn_cpid; if (is_system_labeled()) @@ -3043,6 +3045,7 @@ icmp_output_hdrincl(conn_t *connp, mblk_t *mp, cred_t *cr, pid_t pid) * Caller has a reference on cr; from db_credp or because we * are running in process context. */ + ASSERT(!(ixa->ixa_free_flags & IXA_FREE_CRED)); ixa->ixa_cred = cr; ixa->ixa_cpid = pid; if (is_system_labeled()) { @@ -3056,6 +3059,7 @@ icmp_output_hdrincl(conn_t *connp, mblk_t *mp, cred_t *cr, pid_t pid) /* Get a copy of conn_xmit_ipp since the TX label might change it */ ipp = kmem_zalloc(sizeof (*ipp), KM_NOSLEEP); if (ipp == NULL) { + ASSERT(!(ixa->ixa_free_flags & IXA_FREE_CRED)); ixa->ixa_cred = connp->conn_cred; /* Restore */ ixa->ixa_cpid = connp->conn_cpid; ixa_refrele(ixa); @@ -3291,6 +3295,7 @@ icmp_output_hdrincl(conn_t *connp, mblk_t *mp, cred_t *cr, pid_t pid) break; } done: + ASSERT(!(ixa->ixa_free_flags & IXA_FREE_CRED)); ixa->ixa_cred = connp->conn_cred; /* Restore */ ixa->ixa_cpid = connp->conn_cpid; ixa_refrele(ixa); @@ -3359,6 +3364,7 @@ icmp_output_ancillary(conn_t *connp, sin_t *sin, sin6_t *sin6, mblk_t *mp, return (ENOMEM); } ASSERT(cr != NULL); + ASSERT(!(ixa->ixa_free_flags & IXA_FREE_CRED)); ixa->ixa_cred = cr; ixa->ixa_cpid = pid; if (is_system_labeled()) { @@ -3372,6 +3378,7 @@ icmp_output_ancillary(conn_t *connp, sin_t *sin, sin6_t *sin6, mblk_t *mp, /* Get a copy of conn_xmit_ipp since the options might change it */ ipp = kmem_zalloc(sizeof (*ipp), KM_NOSLEEP); if (ipp == NULL) { + ASSERT(!(ixa->ixa_free_flags & IXA_FREE_CRED)); ixa->ixa_cred = connp->conn_cred; /* Restore */ ixa->ixa_cpid = connp->conn_cpid; ixa_refrele(ixa); @@ -3622,6 +3629,7 @@ icmp_output_ancillary(conn_t *connp, sin_t *sin, sin6_t *sin6, mblk_t *mp, break; } done: + ASSERT(!(ixa->ixa_free_flags & IXA_FREE_CRED)); ixa->ixa_cred = connp->conn_cred; /* Restore */ ixa->ixa_cpid = connp->conn_cpid; ixa_refrele(ixa); @@ -3655,6 +3663,7 @@ icmp_output_connected(conn_t *connp, mblk_t *mp, cred_t *cr, pid_t pid) } ASSERT(cr != NULL); + ASSERT(!(ixa->ixa_free_flags & IXA_FREE_CRED)); ixa->ixa_cred = cr; ixa->ixa_cpid = pid; @@ -3675,6 +3684,7 @@ icmp_output_connected(conn_t *connp, mblk_t *mp, cred_t *cr, pid_t pid) if (mp == NULL) { ASSERT(error != 0); mutex_exit(&connp->conn_lock); + ASSERT(!(ixa->ixa_free_flags & IXA_FREE_CRED)); ixa->ixa_cred = connp->conn_cred; /* Restore */ ixa->ixa_cpid = connp->conn_cpid; ixa_refrele(ixa); @@ -3689,6 +3699,7 @@ icmp_output_connected(conn_t *connp, mblk_t *mp, cred_t *cr, pid_t pid) if (mp == NULL) { mutex_exit(&connp->conn_lock); BUMP_MIB(&is->is_rawip_mib, rawipOutErrors); + ASSERT(!(ixa->ixa_free_flags & IXA_FREE_CRED)); ixa->ixa_cred = connp->conn_cred; /* Restore */ ixa->ixa_cpid = connp->conn_cpid; ixa_refrele(ixa); @@ -3745,6 +3756,7 @@ icmp_output_connected(conn_t *connp, mblk_t *mp, cred_t *cr, pid_t pid) /* FALLTHRU */ default: failed: + ASSERT(!(ixa->ixa_free_flags & IXA_FREE_CRED)); ixa->ixa_cred = connp->conn_cred; /* Restore */ ixa->ixa_cpid = connp->conn_cpid; ixa_refrele(ixa); @@ -3777,6 +3789,7 @@ icmp_output_connected(conn_t *connp, mblk_t *mp, cred_t *cr, pid_t pid) error = ENETUNREACH; break; } + ASSERT(!(ixa->ixa_free_flags & IXA_FREE_CRED)); ixa->ixa_cred = connp->conn_cred; /* Restore */ ixa->ixa_cpid = connp->conn_cpid; ixa_refrele(ixa); @@ -3802,6 +3815,7 @@ icmp_output_lastdst(conn_t *connp, mblk_t *mp, cred_t *cr, pid_t pid, ASSERT(ixa != NULL); ASSERT(cr != NULL); + ASSERT(!(ixa->ixa_free_flags & IXA_FREE_CRED)); ixa->ixa_cred = cr; ixa->ixa_cpid = pid; @@ -3822,6 +3836,7 @@ icmp_output_lastdst(conn_t *connp, mblk_t *mp, cred_t *cr, pid_t pid, if (mp == NULL) { ASSERT(error != 0); mutex_exit(&connp->conn_lock); + ASSERT(!(ixa->ixa_free_flags & IXA_FREE_CRED)); ixa->ixa_cred = connp->conn_cred; /* Restore */ ixa->ixa_cpid = connp->conn_cpid; ixa_refrele(ixa); @@ -3836,6 +3851,7 @@ icmp_output_lastdst(conn_t *connp, mblk_t *mp, cred_t *cr, pid_t pid, if (mp == NULL) { mutex_exit(&connp->conn_lock); BUMP_MIB(&is->is_rawip_mib, rawipOutErrors); + ASSERT(!(ixa->ixa_free_flags & IXA_FREE_CRED)); ixa->ixa_cred = connp->conn_cred; /* Restore */ ixa->ixa_cpid = connp->conn_cpid; ixa_refrele(ixa); @@ -3892,6 +3908,7 @@ icmp_output_lastdst(conn_t *connp, mblk_t *mp, cred_t *cr, pid_t pid, /* FALLTHRU */ default: failed: + ASSERT(!(ixa->ixa_free_flags & IXA_FREE_CRED)); ixa->ixa_cred = connp->conn_cred; /* Restore */ ixa->ixa_cpid = connp->conn_cpid; ixa_refrele(ixa); @@ -3936,6 +3953,7 @@ icmp_output_lastdst(conn_t *connp, mblk_t *mp, cred_t *cr, pid_t pid, mutex_exit(&connp->conn_lock); break; } + ASSERT(!(ixa->ixa_free_flags & IXA_FREE_CRED)); ixa->ixa_cred = connp->conn_cred; /* Restore */ ixa->ixa_cpid = connp->conn_cpid; ixa_refrele(ixa); @@ -4374,6 +4392,7 @@ icmp_output_newdst(conn_t *connp, mblk_t *data_mp, sin_t *sin, sin6_t *sin6, */ ASSERT(cr != NULL); + ASSERT(!(ixa->ixa_free_flags & IXA_FREE_CRED)); ixa->ixa_cred = cr; ixa->ixa_cpid = pid; if (is_system_labeled()) { @@ -4653,12 +4672,14 @@ icmp_output_newdst(conn_t *connp, mblk_t *data_mp, sin_t *sin, sin6_t *sin6, break; } done: + ASSERT(!(ixa->ixa_free_flags & IXA_FREE_CRED)); ixa->ixa_cred = connp->conn_cred; /* Restore */ ixa->ixa_cpid = connp->conn_cpid; ixa_refrele(ixa); return (error); ud_error: + ASSERT(!(ixa->ixa_free_flags & IXA_FREE_CRED)); ixa->ixa_cred = connp->conn_cred; /* Restore */ ixa->ixa_cpid = connp->conn_cpid; ixa_refrele(ixa); diff --git a/usr/src/uts/common/inet/ip/ip.c b/usr/src/uts/common/inet/ip/ip.c index 8cf5e7ea10..0a84ee99a8 100644 --- a/usr/src/uts/common/inet/ip/ip.c +++ b/usr/src/uts/common/inet/ip/ip.c @@ -6213,6 +6213,7 @@ ip_open(queue_t *q, dev_t *devp, int flag, int sflag, cred_t *credp, connp->conn_cred = credp; connp->conn_cpid = curproc->p_pid; /* Cache things in ixa without an extra refhold */ + ASSERT(!(connp->conn_ixa->ixa_free_flags & IXA_FREE_CRED)); connp->conn_ixa->ixa_cred = connp->conn_cred; connp->conn_ixa->ixa_cpid = connp->conn_cpid; if (is_system_labeled()) diff --git a/usr/src/uts/common/inet/ip/ip_attr.c b/usr/src/uts/common/inet/ip/ip_attr.c index c3a55e19bc..53b2c9c652 100644 --- a/usr/src/uts/common/inet/ip/ip_attr.c +++ b/usr/src/uts/common/inet/ip/ip_attr.c @@ -396,10 +396,12 @@ ip_xmit_attr_from_mblk(mblk_t *ixamp, ip_xmit_attr_t *ixa) if (ixm->ixm_tsl != NULL) { ixa->ixa_tsl = ixm->ixm_tsl; ixa->ixa_free_flags |= IXA_FREE_TSL; + ixm->ixm_tsl = NULL; } if (ixm->ixm_cred != NULL) { ixa->ixa_cred = ixm->ixm_cred; ixa->ixa_free_flags |= IXA_FREE_CRED; + ixm->ixm_cred = NULL; } ixa->ixa_cpid = ixm->ixm_cpid; @@ -649,10 +651,12 @@ ip_recv_attr_from_mblk(mblk_t *iramp, ip_recv_attr_t *ira) if (irm->irm_tsl != NULL) { ira->ira_tsl = irm->irm_tsl; ira->ira_free_flags |= IRA_FREE_TSL; + irm->irm_tsl = NULL; } if (irm->irm_cred != NULL) { ira->ira_cred = irm->irm_cred; ira->ira_free_flags |= IRA_FREE_CRED; + irm->irm_cred = NULL; } ira->ira_cpid = irm->irm_cpid; @@ -1110,15 +1114,15 @@ ira_cleanup(ip_recv_attr_t *ira, boolean_t refrele_ill) if (ira->ira_free_flags & IRA_FREE_TSL) { ASSERT(ira->ira_tsl != NULL); label_rele(ira->ira_tsl); - ira->ira_tsl = NULL; ira->ira_free_flags &= ~IRA_FREE_TSL; } + ira->ira_tsl = NULL; if (ira->ira_free_flags & IRA_FREE_CRED) { ASSERT(ira->ira_cred != NULL); crfree(ira->ira_cred); - ira->ira_cred = NULL; ira->ira_free_flags &= ~IRA_FREE_CRED; } + ira->ira_cred = NULL; } /* diff --git a/usr/src/uts/common/inet/ip/rts.c b/usr/src/uts/common/inet/ip/rts.c index d5a1d84395..f5ab423eb0 100644 --- a/usr/src/uts/common/inet/ip/rts.c +++ b/usr/src/uts/common/inet/ip/rts.c @@ -19,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2009 Sun Microsystems, Inc. All rights reserved. + * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -365,6 +365,7 @@ rts_open(int flag, cred_t *credp) connp->conn_cred = credp; connp->conn_cpid = curproc->p_pid; /* Cache things in ixa without an extra refhold */ + ASSERT(!(connp->conn_ixa->ixa_free_flags & IXA_FREE_CRED)); connp->conn_ixa->ixa_cred = connp->conn_cred; connp->conn_ixa->ixa_cpid = connp->conn_cpid; if (is_system_labeled()) diff --git a/usr/src/uts/common/inet/iptun/iptun.c b/usr/src/uts/common/inet/iptun/iptun.c index 1f2798872a..099a14fc2e 100644 --- a/usr/src/uts/common/inet/iptun/iptun.c +++ b/usr/src/uts/common/inet/iptun/iptun.c @@ -1282,6 +1282,7 @@ iptun_conn_create(iptun_t *iptun, netstack_t *ns, cred_t *credp) ASSERT(connp->conn_ref == 1); /* Cache things in ixa without an extra refhold */ + ASSERT(!(connp->conn_ixa->ixa_free_flags & IXA_FREE_CRED)); connp->conn_ixa->ixa_cred = connp->conn_cred; connp->conn_ixa->ixa_cpid = connp->conn_cpid; if (is_system_labeled()) diff --git a/usr/src/uts/common/inet/sctp/sctp_bind.c b/usr/src/uts/common/inet/sctp/sctp_bind.c index b80995628d..1c006ab254 100644 --- a/usr/src/uts/common/inet/sctp/sctp_bind.c +++ b/usr/src/uts/common/inet/sctp/sctp_bind.c @@ -20,7 +20,7 @@ */ /* - * Copyright 2009 Sun Microsystems, Inc. All rights reserved. + * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -150,6 +150,7 @@ sctp_listen(sctp_t *sctp) } /* Cache things in the ixa without any refhold */ + ASSERT(!(connp->conn_ixa->ixa_free_flags & IXA_FREE_CRED)); connp->conn_ixa->ixa_cred = connp->conn_cred; connp->conn_ixa->ixa_cpid = connp->conn_cpid; if (is_system_labeled()) diff --git a/usr/src/uts/common/inet/sctp/sctp_conn.c b/usr/src/uts/common/inet/sctp/sctp_conn.c index 6cf4d9af3e..44524907eb 100644 --- a/usr/src/uts/common/inet/sctp/sctp_conn.c +++ b/usr/src/uts/common/inet/sctp/sctp_conn.c @@ -20,7 +20,7 @@ */ /* - * Copyright 2009 Sun Microsystems, Inc. All rights reserved. + * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -461,6 +461,7 @@ sctp_connect(sctp_t *sctp, const struct sockaddr *dst, uint32_t addrlen, /* Cache things in conn_ixa without any refhold */ ixa = connp->conn_ixa; + ASSERT(!(ixa->ixa_free_flags & IXA_FREE_CRED)); ixa->ixa_cred = cr; ixa->ixa_cpid = pid; if (is_system_labeled()) { diff --git a/usr/src/uts/common/inet/sctp/sctp_ioc.c b/usr/src/uts/common/inet/sctp/sctp_ioc.c index 5f5c2ee629..aecf61002e 100644 --- a/usr/src/uts/common/inet/sctp/sctp_ioc.c +++ b/usr/src/uts/common/inet/sctp/sctp_ioc.c @@ -19,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2009 Sun Microsystems, Inc. All rights reserved. + * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -201,6 +201,7 @@ sctp_str_open(queue_t *q, dev_t *devp, int flag, int sflag, cred_t *credp) crhold(connp->conn_cred); connp->conn_cpid = curproc->p_pid; /* Cache things in ixa without an extra refhold */ + ASSERT(!(connp->conn_ixa->ixa_free_flags & IXA_FREE_CRED)); connp->conn_ixa->ixa_cred = connp->conn_cred; connp->conn_ixa->ixa_cpid = connp->conn_cpid; if (is_system_labeled()) diff --git a/usr/src/uts/common/inet/tcp/tcp.c b/usr/src/uts/common/inet/tcp/tcp.c index 8c746dc33b..63f99b1282 100644 --- a/usr/src/uts/common/inet/tcp/tcp.c +++ b/usr/src/uts/common/inet/tcp/tcp.c @@ -2838,6 +2838,7 @@ tcp_create_common(cred_t *credp, boolean_t isv6, boolean_t issocket, connp->conn_open_time = ddi_get_lbolt64(); /* Cache things in the ixa without any refhold */ + ASSERT(!(connp->conn_ixa->ixa_free_flags & IXA_FREE_CRED)); connp->conn_ixa->ixa_cred = credp; connp->conn_ixa->ixa_cpid = connp->conn_cpid; @@ -4861,6 +4862,7 @@ tcp_do_connect(conn_t *connp, const struct sockaddr *sa, socklen_t len, connp->conn_cpid = pid; /* Cache things in the ixa without any refhold */ + ASSERT(!(ixa->ixa_free_flags & IXA_FREE_CRED)); ixa->ixa_cred = cr; ixa->ixa_cpid = pid; if (is_system_labeled()) { diff --git a/usr/src/uts/common/inet/tcp/tcp_tpi.c b/usr/src/uts/common/inet/tcp/tcp_tpi.c index d46a05ef08..bcaa1595ec 100644 --- a/usr/src/uts/common/inet/tcp/tcp_tpi.c +++ b/usr/src/uts/common/inet/tcp/tcp_tpi.c @@ -1162,6 +1162,7 @@ tcp_accept_swap(tcp_t *listener, tcp_t *acceptor, tcp_t *eager) if (econnp->conn_cred != NULL) crfree(econnp->conn_cred); econnp->conn_cred = aconnp->conn_cred; + ASSERT(!(econnp->conn_ixa->ixa_free_flags & IXA_FREE_CRED)); econnp->conn_ixa->ixa_cred = econnp->conn_cred; aconnp->conn_cred = NULL; econnp->conn_cpid = aconnp->conn_cpid; diff --git a/usr/src/uts/common/inet/udp/udp.c b/usr/src/uts/common/inet/udp/udp.c index 53e1185fa1..fc9842bb7d 100644 --- a/usr/src/uts/common/inet/udp/udp.c +++ b/usr/src/uts/common/inet/udp/udp.c @@ -3112,6 +3112,7 @@ udp_output_ancillary(conn_t *connp, sin_t *sin, sin6_t *sin6, mblk_t *mp, return (ENOMEM); } ASSERT(cr != NULL); + ASSERT(!(ixa->ixa_free_flags & IXA_FREE_CRED)); ixa->ixa_cred = cr; ixa->ixa_cpid = pid; if (is_system_labeled()) { @@ -3125,6 +3126,7 @@ udp_output_ancillary(conn_t *connp, sin_t *sin, sin6_t *sin6, mblk_t *mp, /* Get a copy of conn_xmit_ipp since the options might change it */ ipp = kmem_zalloc(sizeof (*ipp), KM_NOSLEEP); if (ipp == NULL) { + ASSERT(!(ixa->ixa_free_flags & IXA_FREE_CRED)); ixa->ixa_cred = connp->conn_cred; /* Restore */ ixa->ixa_cpid = connp->conn_cpid; ixa_refrele(ixa); @@ -3356,6 +3358,7 @@ udp_output_ancillary(conn_t *connp, sin_t *sin, sin6_t *sin6, mblk_t *mp, break; } done: + ASSERT(!(ixa->ixa_free_flags & IXA_FREE_CRED)); ixa->ixa_cred = connp->conn_cred; /* Restore */ ixa->ixa_cpid = connp->conn_cpid; ixa_refrele(ixa); @@ -3388,6 +3391,7 @@ udp_output_connected(conn_t *connp, mblk_t *mp, cred_t *cr, pid_t pid) } ASSERT(cr != NULL); + ASSERT(!(ixa->ixa_free_flags & IXA_FREE_CRED)); ixa->ixa_cred = cr; ixa->ixa_cpid = pid; @@ -3398,6 +3402,7 @@ udp_output_connected(conn_t *connp, mblk_t *mp, cred_t *cr, pid_t pid) if (mp == NULL) { ASSERT(error != 0); mutex_exit(&connp->conn_lock); + ASSERT(!(ixa->ixa_free_flags & IXA_FREE_CRED)); ixa->ixa_cred = connp->conn_cred; /* Restore */ ixa->ixa_cpid = connp->conn_cpid; ixa_refrele(ixa); @@ -3455,6 +3460,7 @@ udp_output_connected(conn_t *connp, mblk_t *mp, cred_t *cr, pid_t pid) /* FALLTHRU */ default: failed: + ASSERT(!(ixa->ixa_free_flags & IXA_FREE_CRED)); ixa->ixa_cred = connp->conn_cred; /* Restore */ ixa->ixa_cpid = connp->conn_cpid; ixa_refrele(ixa); @@ -3488,6 +3494,7 @@ udp_output_connected(conn_t *connp, mblk_t *mp, cred_t *cr, pid_t pid) error = ENETUNREACH; break; } + ASSERT(!(ixa->ixa_free_flags & IXA_FREE_CRED)); ixa->ixa_cred = connp->conn_cred; /* Restore */ ixa->ixa_cpid = connp->conn_cpid; ixa_refrele(ixa); @@ -3512,6 +3519,7 @@ udp_output_lastdst(conn_t *connp, mblk_t *mp, cred_t *cr, pid_t pid, ASSERT(ixa != NULL); ASSERT(cr != NULL); + ASSERT(!(ixa->ixa_free_flags & IXA_FREE_CRED)); ixa->ixa_cred = cr; ixa->ixa_cpid = pid; @@ -3521,6 +3529,7 @@ udp_output_lastdst(conn_t *connp, mblk_t *mp, cred_t *cr, pid_t pid, if (mp == NULL) { ASSERT(error != 0); mutex_exit(&connp->conn_lock); + ASSERT(!(ixa->ixa_free_flags & IXA_FREE_CRED)); ixa->ixa_cred = connp->conn_cred; /* Restore */ ixa->ixa_cpid = connp->conn_cpid; ixa_refrele(ixa); @@ -3578,6 +3587,7 @@ udp_output_lastdst(conn_t *connp, mblk_t *mp, cred_t *cr, pid_t pid, /* FALLTHRU */ default: failed: + ASSERT(!(ixa->ixa_free_flags & IXA_FREE_CRED)); ixa->ixa_cred = connp->conn_cred; /* Restore */ ixa->ixa_cpid = connp->conn_cpid; ixa_refrele(ixa); @@ -3623,6 +3633,7 @@ udp_output_lastdst(conn_t *connp, mblk_t *mp, cred_t *cr, pid_t pid, mutex_exit(&connp->conn_lock); break; } + ASSERT(!(ixa->ixa_free_flags & IXA_FREE_CRED)); ixa->ixa_cred = connp->conn_cred; /* Restore */ ixa->ixa_cpid = connp->conn_cpid; ixa_refrele(ixa); @@ -4147,6 +4158,7 @@ udp_output_newdst(conn_t *connp, mblk_t *data_mp, sin_t *sin, sin6_t *sin6, */ ASSERT(cr != NULL); + ASSERT(!(ixa->ixa_free_flags & IXA_FREE_CRED)); ixa->ixa_cred = cr; ixa->ixa_cpid = pid; if (is_system_labeled()) { @@ -4422,12 +4434,14 @@ udp_output_newdst(conn_t *connp, mblk_t *data_mp, sin_t *sin, sin6_t *sin6, mutex_exit(&connp->conn_lock); break; } + ASSERT(!(ixa->ixa_free_flags & IXA_FREE_CRED)); ixa->ixa_cred = connp->conn_cred; /* Restore */ ixa->ixa_cpid = connp->conn_cpid; ixa_refrele(ixa); return (error); ud_error: + ASSERT(!(ixa->ixa_free_flags & IXA_FREE_CRED)); ixa->ixa_cred = connp->conn_cred; /* Restore */ ixa->ixa_cpid = connp->conn_cpid; ixa_refrele(ixa); @@ -5173,6 +5187,7 @@ udp_do_open(cred_t *credp, boolean_t isv6, int flags, int *errorp) connp->conn_cpid = curproc->p_pid; connp->conn_open_time = ddi_get_lbolt64(); /* Cache things in ixa without an extra refhold */ + ASSERT(!(connp->conn_ixa->ixa_free_flags & IXA_FREE_CRED)); connp->conn_ixa->ixa_cred = connp->conn_cred; connp->conn_ixa->ixa_cpid = connp->conn_cpid; if (is_system_labeled()) @@ -6225,6 +6240,7 @@ udp_do_connect(conn_t *connp, const struct sockaddr *sa, socklen_t len, connp->conn_cred = cr; } connp->conn_cpid = pid; + ASSERT(!(ixa->ixa_free_flags & IXA_FREE_CRED)); ixa->ixa_cred = cr; ixa->ixa_cpid = pid; if (is_system_labeled()) { |