linux/drivers/net/can/ctucanfd
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
..
ctucanfd_base.c can: dev: fix skb drop check 2022-11-07 14:00:27 +01:00
ctucanfd_kframe.h
ctucanfd_kregs.h can: ctucanfd: Update CTU CAN FD IP core registers to match version 3.x. 2022-07-19 20:57:46 +02:00
ctucanfd_pci.c can: ctucanfd: remove PCI module debug parameters 2022-05-02 09:24:41 +02:00
ctucanfd_platform.c can: ctucanfd: Remove redundant dev_err call 2022-09-23 13:55:01 +02:00
ctucanfd.h
Kconfig can: ctucanfd: platform: add missing dependency to HAS_IOMEM 2022-05-23 22:00:06 +02:00
Makefile can: ctucanfd: CTU CAN FD open-source IP core - platform/SoC support. 2022-04-19 17:12:14 +02:00