git: 2f0656fb9ba2 - main - sctp: don't hold the assoc create lock longer than needed

From: Michael Tuexen <tuexen_at_FreeBSD.org>
Date: Sun, 20 Feb 2022 13:57:24 UTC
The branch main has been updated by tuexen:

URL: https://cgit.FreeBSD.org/src/commit/?id=2f0656fb9ba2b962be7f545763fd8c55640ded00

commit 2f0656fb9ba2b962be7f545763fd8c55640ded00
Author:     Michael Tuexen <tuexen@FreeBSD.org>
AuthorDate: 2022-02-20 13:55:41 +0000
Commit:     Michael Tuexen <tuexen@FreeBSD.org>
CommitDate: 2022-02-20 13:55:41 +0000

    sctp: don't hold the assoc create lock longer than needed
    
    Reported by:    syzbot+c738e3df67cf425c49a2@syzkaller.appspotmail.com
    MFC after:      3 days
---
 sys/netinet/sctp_output.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c
index 3d81fb2b4288..86cf2ed75e90 100644
--- a/sys/netinet/sctp_output.c
+++ b/sys/netinet/sctp_output.c
@@ -12716,6 +12716,8 @@ sctp_lower_sosend(struct socket *so,
 		} else {
 			SCTP_TCB_LOCK_ASSERT(stcb);
 			hold_tcblock = true;
+			SCTP_ASOC_CREATE_UNLOCK(inp);
+			create_lock_applied = false;
 		}
 		if (error) {
 			goto out_unlocked;