git: 73fd47690145 - stable/13 - sctp: don't hold the assoc create lock longer than needed

From: Michael Tuexen <tuexen_at_FreeBSD.org>
Date: Wed, 23 Feb 2022 00:19:35 UTC
The branch stable/13 has been updated by tuexen:

URL: https://cgit.FreeBSD.org/src/commit/?id=73fd476901453027cec9fd15e910c15e6b97a16a

commit 73fd476901453027cec9fd15e910c15e6b97a16a
Author:     Michael Tuexen <tuexen@FreeBSD.org>
AuthorDate: 2022-02-20 13:55:41 +0000
Commit:     Michael Tuexen <tuexen@FreeBSD.org>
CommitDate: 2022-02-23 00:18:05 +0000

    sctp: don't hold the assoc create lock longer than needed
    
    Reported by:    syzbot+c738e3df67cf425c49a2@syzkaller.appspotmail.com
    
    (cherry picked from commit 2f0656fb9ba2b962be7f545763fd8c55640ded00)
---
 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;