linux/drivers/net/can/m_can
Oliver Hartkopp ae64438be1 can: dev: fix skb drop check
In commit a6d190f8c7 ("can: skb: drop tx skb if in listen only
mode") the priv->ctrlmode element is read even on virtual CAN
interfaces that do not create the struct can_priv at startup. This
out-of-bounds read may lead to CAN frame drops for virtual CAN
interfaces like vcan and vxcan.

This patch mainly reverts the original commit and adds a new helper
for CAN interface drivers that provide the required information in
struct can_priv.

Fixes: a6d190f8c7 ("can: skb: drop tx skb if in listen only mode")
Reported-by: Dariusz Stojaczyk <Dariusz.Stojaczyk@opensynergy.com>
Cc: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Cc: Max Staudt <max@enpas.org>
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Acked-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Link: https://lore.kernel.org/all/20221102095431.36831-1-socketcan@hartkopp.net
Cc: stable@vger.kernel.org # 6.0.x
[mkl: patch pch_can, too]
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2022-11-07 14:00:27 +01:00
..
Kconfig can: Kconfig: add CONFIG_CAN_RX_OFFLOAD 2022-06-11 17:11:02 +02:00
m_can_pci.c Revert "can: m_can: pci: use custom bit timings for Elkhart Lake" 2022-05-14 20:49:09 +02:00
m_can_platform.c can: m_can: fix iomap_read_fifo() and iomap_write_fifo() 2021-10-17 22:51:43 +02:00
m_can.c can: dev: fix skb drop check 2022-11-07 14:00:27 +01:00
m_can.h can: can-dev: remove obsolete CAN LED support 2022-05-19 22:15:51 +02:00
Makefile can: tcan4x5x: move regmap code into seperate file 2021-01-06 15:15:37 +01:00
tcan4x5x-core.c spi: make remove callback a void function 2022-02-09 13:00:45 +00:00
tcan4x5x-regmap.c can: tcan4x5x: regmap: fix max register value 2022-01-24 18:27:43 +01:00
tcan4x5x.h can: tcan4x5x: remove duplicate include of regmap.h 2021-03-30 11:14:48 +02:00