Re: [PATCH net] sctp: fix the issue sctp_diag uses lock_sock in rcu_read_lock

2016-09-29 Thread David Miller
From: Xin Long Date: Thu, 29 Sep 2016 02:55:44 +0800 > 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. > Aft

[PATCH net] sctp: fix the issue sctp_diag uses lock_sock in rcu_read_lock

2016-09-28 Thread Xin Long
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 wil