]> git.itanic.dy.fi Git - linux-stable/commit
can: dev: can_put_echo_skb(): don't crash kernel if can_priv::echo_skb is accessed...
authorMarc Kleine-Budde <mkl@pengutronix.de>
Fri, 29 Sep 2023 08:23:47 +0000 (10:23 +0200)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Thu, 5 Oct 2023 19:34:13 +0000 (21:34 +0200)
commit6411959c10fe917288cbb1038886999148560057
tree5569cd7fa8f9cbce1ae030fd35508c46f60c1e1a
parentf0e0c809c0be05fe865b9ac128ef3ee35c276021
can: dev: can_put_echo_skb(): don't crash kernel if can_priv::echo_skb is accessed out of bounds

If the "struct can_priv::echoo_skb" is accessed out of bounds, this
would cause a kernel crash. Instead, issue a meaningful warning
message and return with an error.

Fixes: a6e4bc530403 ("can: make the number of echo skb's configurable")
Link: https://lore.kernel.org/all/20231005-can-dev-fix-can-restart-v2-5-91b5c1fd922c@pengutronix.de
Reviewed-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/dev/skb.c