Fix an off-by-one error in the input validation of the SCTP_RESET_STREAMS
socketoption. This was found by running syzkaller. MFC after: 3 days
This commit is contained in:
parent
0086006e74
commit
78654493eb
@ -4654,13 +4654,13 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
|
|||||||
}
|
}
|
||||||
for (i = 0; i < strrst->srs_number_streams; i++) {
|
for (i = 0; i < strrst->srs_number_streams; i++) {
|
||||||
if ((send_in) &&
|
if ((send_in) &&
|
||||||
(strrst->srs_stream_list[i] > stcb->asoc.streamincnt)) {
|
(strrst->srs_stream_list[i] >= stcb->asoc.streamincnt)) {
|
||||||
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
|
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
|
||||||
error = EINVAL;
|
error = EINVAL;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if ((send_out) &&
|
if ((send_out) &&
|
||||||
(strrst->srs_stream_list[i] > stcb->asoc.streamoutcnt)) {
|
(strrst->srs_stream_list[i] >= stcb->asoc.streamoutcnt)) {
|
||||||
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
|
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
|
||||||
error = EINVAL;
|
error = EINVAL;
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user