Commit ee598530 authored by Xin Long's avatar Xin Long Committed by Greg Kroah-Hartman

sctp: change to hold sk after auth shkey is created successfully

[ Upstream commit 25bff6d5478b2a02368097015b7d8eb727c87e16 ]

Now in sctp_endpoint_init(), it holds the sk then creates auth
shkey. But when the creation fails, it doesn't release the sk,
which causes a sk defcnf leak,

Here to fix it by only holding the sk when auth shkey is created

Fixes: a29a5bd4 ("[SCTP]: Implement SCTP-AUTH initializations.")
Signed-off-by: default avatarXin Long <>
Acked-by: default avatarNeil Horman <>
Signed-off-by: default avatarDavid S. Miller <>
Signed-off-by: default avatarGreg Kroah-Hartman <>
parent 2365b9b2
......@@ -126,10 +126,6 @@ static struct sctp_endpoint *sctp_endpoint_init(struct sctp_endpoint *ep,
/* Initialize the bind addr area */
sctp_bind_addr_init(&ep->base.bind_addr, 0);
/* Remember who we are attached to. */
ep-> = sk;
/* Create the lists of associations. */
......@@ -167,6 +163,10 @@ static struct sctp_endpoint *sctp_endpoint_init(struct sctp_endpoint *ep,
ep->prsctp_enable = net->sctp.prsctp_enable;
ep->reconf_enable = net->sctp.reconf_enable;
/* Remember who we are attached to. */
ep-> = sk;
return ep;
Markdown is supported
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