]> git.ipfire.org Git - thirdparty/kernel/stable.git/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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 20 Nov 2023 10:56:51 +0000 (11:56 +0100)
commit53c468008a7c9ca3f5fc985951f35ec2acae85bc
treeda9761b6c8f85bf045d9dbf46b1d6cb1fd758f5d
parentb20ffe03852c496ea2b9a0defb323f1feab19671
can: dev: can_put_echo_skb(): don't crash kernel if can_priv::echo_skb is accessed out of bounds

[ Upstream commit 6411959c10fe917288cbb1038886999148560057 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/can/dev/skb.c