Xin Long 1cceda7849 sctp: fix the issue sctp_diag uses lock_sock in rcu_read_lock
When sctp dumps all the ep->assocs, it needs to lock_sock first,
but now it locks sock in rcu_read_lock, and lock_sock may sleep,
which would break rcu_read_lock.

This patch is to get and hold one sock when traversing the list.
After that and get out of rcu_read_lock, lock and dump it. Then
it will traverse the list again to get the next one until all
sctp socks are dumped.

For sctp_diag_dump_one, it fixes this issue by holding asoc and
moving cb() out of rcu_read_lock in sctp_transport_lookup_process.

Fixes: 8f840e47f190 ("sctp: add the sctp_diag.c file")
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-09-30 02:08:57 -04:00
..
2016-06-28 05:26:14 -04:00
2016-07-05 14:08:47 -07:00
2016-08-31 21:00:19 -07:00
2015-10-23 03:05:19 -07:00
2016-05-29 22:33:25 -07:00
2016-09-27 09:53:17 -04:00
2016-06-09 23:41:03 -07:00
2016-07-19 20:49:16 -07:00
2016-07-19 20:49:16 -07:00