]> git.baikalelectronics.ru Git - kernel.git/commit
sctp: change to hold sk after auth shkey is created successfully
authorXin Long <lucien.xin@gmail.com>
Mon, 24 Jun 2019 16:21:45 +0000 (00:21 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 27 Jun 2019 02:29:23 +0000 (19:29 -0700)
commite173cf23646997ed826cd57c8d4494f5ea60ced1
tree75263bded0f1416c8958a00d201ded2370872e40
parent607ceb2f016e9cc6b72bbfe6f0d395f7c255294b
sctp: change to hold sk after auth shkey is created successfully

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
successfully.

Fixes: 25ad9a48825b ("[SCTP]: Implement SCTP-AUTH initializations.")
Reported-by: syzbot+afabda3890cc2f765041@syzkaller.appspotmail.com
Reported-by: syzbot+276ca1c77a19977c0130@syzkaller.appspotmail.com
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Acked-by: Neil Horman <nhorman@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sctp/endpointola.c