kernel_optimize_test/net/6lowpan
Colin Ian King c7ebd3622b 6lowpan: iphc: Fix an off-by-one check of array index
[ Upstream commit 9af417610b6142e826fd1ee8ba7ff3e9a2133a5a ]

The bounds check of id is off-by-one and the comparison should
be >= rather >. Currently the WARN_ON_ONCE check does not stop
the out of range indexing of &ldev->ctx.table[id] so also add
a return path if the bounds are out of range.

Addresses-Coverity: ("Illegal address computation").
Fixes: 5609c185f2 ("6lowpan: iphc: add support for stateful compression")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-09-15 09:50:34 +02:00
..
6lowpan_i.h
core.c
debugfs.c
iphc.c
Kconfig
Makefile
ndisc.c
nhc_dest.c
nhc_fragment.c
nhc_ghc_ext_dest.c
nhc_ghc_ext_frag.c
nhc_ghc_ext_hop.c
nhc_ghc_ext_route.c
nhc_ghc_icmpv6.c
nhc_ghc_udp.c
nhc_hop.c
nhc_ipv6.c
nhc_mobility.c
nhc_routing.c
nhc_udp.c
nhc.c
nhc.h