sctp: fix double unlock in case adding a remote address fails

Thanks to glebius@ for pointing to the problem.

Reported by:	syzbot+1d5c164f1c10de84ad8a@syzkaller.appspotmail.com
Fixes:		2d5c48eccd9f ("sctp: Tighten up locking around sctp_aloc_assoc()")

(cherry picked from commit e8623834ca29b562687db945bdd12a3e2fe4aeb1)
This commit is contained in:
Michael Tuexen 2025-03-31 03:25:53 +02:00 committed by Franco Fichtner
parent 0f962476d4
commit 4d2ba6d834

View File

@ -4233,7 +4233,6 @@ sctp_aloc_assoc_locked(struct sctp_inpcb *inp, struct sockaddr *firstaddr,
LIST_REMOVE(stcb, sctp_asocs);
LIST_REMOVE(stcb, sctp_tcbasocidhash);
SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_asoc), stcb);
SCTP_INP_WUNLOCK(inp);
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PCB, ENOBUFS);
*error = ENOBUFS;
return (NULL);