linux-stable/drivers/net/can/sja1000
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
..
ems_pci.c module: remove never implemented MODULE_SUPPORTED_DEVICE 2021-03-17 13:16:18 -07:00
ems_pcmcia.c can: sja1000: fix use after free in ems_pcmcia_add_card() 2021-12-07 09:08:58 +01:00
f81601.c can: sja1000: f81601: remove unused including <linux/version.h> 2019-08-13 16:37:03 +02:00
Kconfig can: Fix Links to Technologic Systems web resources 2022-04-19 17:12:12 +02:00
kvaser_pci.c module: remove never implemented MODULE_SUPPORTED_DEVICE 2021-03-17 13:16:18 -07:00
Makefile can: sja1000: f81601: add Fintek F81601 support 2019-07-24 10:30:37 +02:00
peak_pci.c can: peak_pci: peak_pci_remove(): fix UAF 2021-10-17 22:51:50 +02:00
peak_pcmcia.c net: move from strlcpy with unused retval to strscpy 2022-08-31 14:11:07 -07:00
plx_pci.c module: remove never implemented MODULE_SUPPORTED_DEVICE 2021-03-17 13:16:18 -07:00
sja1000.c can: dev: fix skb drop check 2022-11-07 14:00:27 +01:00
sja1000.h can: sja1000: Add Quirk for RZ/N1 SJA1000 CAN controller 2022-07-19 20:46:59 +02:00
sja1000_isa.c remove ioremap_nocache and devm_ioremap_nocache 2020-01-06 09:45:59 +01:00
sja1000_platform.c can: sja1000: Add support for RZ/N1 SJA1000 CAN Controller 2022-09-05 22:00:43 +02:00
tscan1.c can: Fix Links to Technologic Systems web resources 2022-04-19 17:12:12 +02:00