can: dev: __can_get_echo_skb(): Don't crash the kernel if can_priv::echo_skb is acces...
authorMarc Kleine-Budde <mkl@pengutronix.de>
Wed, 31 Oct 2018 13:05:26 +0000 (14:05 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 1 Dec 2018 08:42:52 +0000 (09:42 +0100)
commitbf991335b02d62e067e09471b15cf2216d54d5cf
tree0f3442cd42c993f70f50fac62bd131b4a542d061
parent3f6b2bbbee20a5aa52eed1aaea65cdab98aed8c6
can: dev: __can_get_echo_skb(): Don't crash the kernel if can_priv::echo_skb is accessed out of bounds

commit e7a6994d043a1e31d5b17706a22ce33d2a3e4cdc upstream.

If the "struct can_priv::echo_skb" is accessed out of bounds would lead
to a kernel crash. Better print a sensible warning message instead and
try to recover.

Cc: linux-stable <stable@vger.kernel.org>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/can/dev.c