sctp: fix a potential OOB access in sctp_sched_set_sched()
authorIlia.Gavrilov <Ilia.Gavrilov@infotecs.ru>
Wed, 10 May 2023 09:23:40 +0000 (09:23 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 10 May 2023 11:10:15 +0000 (12:10 +0100)
commit059fa492027e99c167f4c53822c0900ca9bc254a
tree4cbbd0368fe327351b6dba9cc497b6d2097ff11b
parent6096bc0555726c1cdded8486d8800cd4d81eb764
sctp: fix a potential OOB access in sctp_sched_set_sched()

The 'sched' index value must be checked before accessing an element
of the 'sctp_sched_ops' array. Otherwise, it can lead to OOB access.

Note that it's harmless since the 'sched' parameter is checked before
calling 'sctp_sched_set_sched'.

Found by InfoTeCS on behalf of Linux Verification Center
(linuxtesting.org) with SVACE.

Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Reviewed-by: Xin Long <lucien.xin@gmail.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: Ilia.Gavrilov <Ilia.Gavrilov@infotecs.ru>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sctp/stream_sched.c