]> git.baikalelectronics.ru Git - kernel.git/commit
netdevsim: fix sa_idx out of bounds check
authorColin Ian King <colin.king@canonical.com>
Sat, 30 Jun 2018 20:39:24 +0000 (21:39 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 2 Jul 2018 11:35:33 +0000 (20:35 +0900)
commit8b2bb75f8563e5c4a6ca6e5be87b5fe463525b1d
treeb2f16ab0e4ee8515a885314343cd9cd4638fd5aa
parente15171fb0376b5bbdcc3ce754dd0a0c18a3369b2
netdevsim: fix sa_idx out of bounds check

Currently if sa_idx is equal to NSIM_IPSEC_MAX_SA_COUNT then
an out-of-bounds read on ipsec->sa will occur. Fix the
incorrect bounds check by using >= rather than >.

Detected by CoverityScan, CID#1470226 ("Out-of-bounds-read")

Fixes: 8568a35666a5 ("netdevsim: add ipsec offload testing")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Shannon Nelson <shannon.nelson@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/netdevsim/ipsec.c