sctp: hold endpoint before calling cb in sctp_transport_lookup_process
authorXin Long <lucien.xin@gmail.com>
Fri, 31 Dec 2021 23:37:37 +0000 (18:37 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 Jan 2022 14:35:14 +0000 (15:35 +0100)
commit9f00a2a0c139588b7298e58c8c667f6d7ff37a5b
tree4232c7a17acd2dc631e350436f88cb58bf041940
parent3c5c81d1e3504e756dc1d8610c3bbdbc947fa5d5
sctp: hold endpoint before calling cb in sctp_transport_lookup_process

commit f9d31c4cf4c11ff10317f038b9c6f7c3bda6cdd4 upstream.

The same fix in commit 5ec7d18d1813 ("sctp: use call_rcu to free endpoint")
is also needed for dumping one asoc and sock after the lookup.

Fixes: 86fdb3448cc1 ("sctp: ensure ep is not destroyed before doing the dump")
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/net/sctp/sctp.h
net/sctp/diag.c
net/sctp/socket.c