Commit d83caf5c authored by Marc Kleine-Budde's avatar Marc Kleine-Budde Committed by Yipeng Zou
Browse files

can: dev: can_put_echo_skb(): don't crash kernel if can_priv::echo_skb is accessed out of bounds

mainline inclusion
from mainline-v6.7-rc1
commit 6411959c10fe917288cbb1038886999148560057
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/I9REA2
CVE: CVE-2023-52878

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.9.2&id=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: a6e4bc53 ("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: default avatarVincent Mailhol <mailhol.vincent@wanadoo.fr>
Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>

Conflicts:
            drivers/net/can/dev/skb.c
	    drivers/net/can/dev/dev.c
[Since 18f2dbfd ("can: dev: move skb related into seperate file")
can_put_echo_skb has been moved to skb.c without any functional change.
So we can fix this cve directly in dev.c.]
Signed-off-by: default avatarYipeng Zou <zouyipeng@huawei.com>
parent 5dac66de
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment