Skip to content
Commit 86fdb344 authored by Xin Long's avatar Xin Long Committed by David S. Miller
Browse files

sctp: ensure ep is not destroyed before doing the dump



Now before dumping a sock in sctp_diag, it only holds the sock while
the ep may be already destroyed. It can cause a use-after-free panic
when accessing ep->asocs.

This patch is to set sctp_sk(sk)->ep NULL in sctp_endpoint_destroy,
and check if this ep is already destroyed before dumping this ep.

Suggested-by: default avatarMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
Acked-by: default avatarNeil Horman <nhorman@tuxdrver.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7fe5b914
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment