Fix locking for IPPROTO_SCTP level SCTP_DEFAULT_PRINFO socket option.

This problem occurred when calling setsockopt() will invalid parameters.

This issue was found by running syzkaller.

MFC after:		3 days
This commit is contained in:
Michael Tuexen 2019-02-10 08:28:56 +00:00
parent f6f8a42129
commit 333669e016

View File

@ -6209,6 +6209,9 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
SCTP_FIND_STCB(inp, stcb, info->pr_assoc_id);
if (info->pr_policy > SCTP_PR_SCTP_MAX) {
if (stcb) {
SCTP_TCB_UNLOCK(stcb);
}
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
error = EINVAL;
break;