]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: sctp: fix array overrun read on sctp_timer_tbl
authorColin Ian King <colin.king@canonical.com>
Fri, 20 Jan 2017 13:01:57 +0000 (13:01 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 9 Dec 2017 17:29:47 +0000 (18:29 +0100)
commit7c3f696de8d19e56b8685ab70eba5e139e61696f
tree58be2843fc6ff94600504a24f2bb1b3215a1b238
parent741a5969398f43203bf09768d9b7983eeeee0d29
net: sctp: fix array overrun read on sctp_timer_tbl

[ Upstream commit 0e73fc9a56f22f2eec4d2b2910c649f7af67b74d ]

The comparison on the timeout can lead to an array overrun
read on sctp_timer_tbl because of an off-by-one error. Fix
this by using < instead of <= and also compare to the array
size rather than SCTP_EVENT_TIMEOUT_MAX.

Fixes CoverityScan CID#1397639 ("Out-of-bounds read")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/sctp/debug.c