linux/net
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: 8f840e47f1 ("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
..
6lowpan
9p 9p/trans_virtio: use kvfree() for iov_iter_get_pages_alloc() 2016-08-09 13:42:36 +03:00
802
8021q net: remove type_check from dev_get_nest_level() 2016-08-13 15:15:54 -07:00
appletalk
atm
ax25
batman-adv batman-adv: fix elp packet data reservation 2016-08-26 15:22:31 +02:00
bluetooth Bluetooth: Fix hci_sock_recvmsg when MSG_TRUNC is not set 2016-08-25 20:58:47 +02:00
bridge net: bridge: don't increment tx_dropped in br_do_proxy_arp 2016-09-01 16:35:30 -07:00
caif
can
ceph libceph: using kfree_rcu() to simplify the code 2016-08-08 21:41:42 +02:00
core cgroup: duplicate cgroup reference when cloning sockets 2016-09-19 15:36:17 -07:00
dcb
dccp Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security 2016-07-29 17:38:46 -07:00
decnet
dns_resolver
dsa
ethernet
hsr
ieee802154
ipv4 ipmr, ip6mr: fix scheduling while atomic and a deadlock with ipmr_get_route 2016-09-25 23:41:39 -04:00
ipv6 ipmr, ip6mr: fix scheduling while atomic and a deadlock with ipmr_get_route 2016-09-25 23:41:39 -04:00
ipx
irda irda: Free skb on irda_accept error path. 2016-09-17 09:59:31 -04:00
iucv Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security 2016-07-29 17:38:46 -07:00
kcm kcm: fix a socket double free 2016-08-31 21:00:19 -07:00
key
l2tp l2tp: fix use-after-free during module unload 2016-09-02 11:44:44 -07:00
l3mdev
lapb
llc
mac80211 mac80211: reject TSPEC TIDs (TSIDs) for aggregation 2016-09-15 10:08:52 +02:00
mac802154
mpls
ncsi
netfilter netfilter: synproxy: Check oom when adding synproxy and seqadj ct extensions 2016-09-13 10:50:56 +02:00
netlabel
netlink
netrom
nfc
openvswitch openvswitch: do not ignore netdev errors when creating tunnel vports 2016-08-10 23:13:23 -07:00
packet
phonet
qrtr
rds
rfkill
rose
rxrpc rxrpc: Free packets discarded in data_ready 2016-08-09 17:13:56 +01:00
sched act_ife: Fix false encoding 2016-09-27 09:53:17 -04:00
sctp sctp: fix the issue sctp_diag uses lock_sock in rcu_read_lock 2016-09-30 02:08:57 -04:00
sunrpc Fix a memory corruption bug that I introduced in 4.7. 2016-09-16 17:00:26 -07:00
switchdev
tipc tipc: fix random link resets while adding a second bearer 2016-09-01 10:12:26 -07:00
unix af_unix: split 'u->readlock' into two: 'iolock' and 'bindlock' 2016-09-04 13:29:29 -07:00
vmw_vsock VSOCK: Don't dec ack backlog twice for rejected connections 2016-09-27 07:59:25 -04:00
wimax
wireless nl80211: validate number of probe response CSA counters 2016-09-13 20:19:27 +02:00
x25
xfrm xfrm: Fix memory leak of aead algorithm name 2016-09-19 12:08:58 +02:00
compat.c
Kconfig
Makefile
socket.c
sysctl_net.c