aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp/proc.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sctp/proc.c')
-rw-r--r--net/sctp/proc.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/net/sctp/proc.c b/net/sctp/proc.c
index 06b05ee17d8d..8c19e97262ca 100644
--- a/net/sctp/proc.c
+++ b/net/sctp/proc.c
@@ -162,15 +162,20 @@ static void sctp_seq_dump_remote_addrs(struct seq_file *seq, struct sctp_associa
162 struct sctp_af *af; 162 struct sctp_af *af;
163 163
164 primary = &assoc->peer.primary_addr; 164 primary = &assoc->peer.primary_addr;
165 list_for_each_entry(transport, &assoc->peer.transport_addr_list, 165 rcu_read_lock();
166 list_for_each_entry_rcu(transport, &assoc->peer.transport_addr_list,
166 transports) { 167 transports) {
167 addr = &transport->ipaddr; 168 addr = &transport->ipaddr;
169 if (transport->dead)
170 continue;
171
168 af = sctp_get_af_specific(addr->sa.sa_family); 172 af = sctp_get_af_specific(addr->sa.sa_family);
169 if (af->cmp_addr(addr, primary)) { 173 if (af->cmp_addr(addr, primary)) {
170 seq_printf(seq, "*"); 174 seq_printf(seq, "*");
171 } 175 }
172 af->seq_dump_addr(seq, addr); 176 af->seq_dump_addr(seq, addr);
173 } 177 }
178 rcu_read_unlock();
174} 179}
175 180
176static void * sctp_eps_seq_start(struct seq_file *seq, loff_t *pos) 181static void * sctp_eps_seq_start(struct seq_file *seq, loff_t *pos)
@@ -441,12 +446,16 @@ static int sctp_remaddr_seq_show(struct seq_file *seq, void *v)
441 head = &sctp_assoc_hashtable[hash]; 446 head = &sctp_assoc_hashtable[hash];
442 sctp_local_bh_disable(); 447 sctp_local_bh_disable();
443 read_lock(&head->lock); 448 read_lock(&head->lock);
449 rcu_read_lock();
444 sctp_for_each_hentry(epb, node, &head->chain) { 450 sctp_for_each_hentry(epb, node, &head->chain) {
445 if (!net_eq(sock_net(epb->sk), seq_file_net(seq))) 451 if (!net_eq(sock_net(epb->sk), seq_file_net(seq)))
446 continue; 452 continue;
447 assoc = sctp_assoc(epb); 453 assoc = sctp_assoc(epb);
448 list_for_each_entry(tsp, &assoc->peer.transport_addr_list, 454 list_for_each_entry_rcu(tsp, &assoc->peer.transport_addr_list,
449 transports) { 455 transports) {
456 if (tsp->dead)
457 continue;
458
450 /* 459 /*
451 * The remote address (ADDR) 460 * The remote address (ADDR)
452 */ 461 */
@@ -492,6 +501,7 @@ static int sctp_remaddr_seq_show(struct seq_file *seq, void *v)
492 } 501 }
493 } 502 }
494 503
504 rcu_read_unlock();
495 read_unlock(&head->lock); 505 read_unlock(&head->lock);
496 sctp_local_bh_enable(); 506 sctp_local_bh_enable();
497 507