linux-stable/drivers/net/can/dev
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
..
Makefile can: Kconfig: add CONFIG_CAN_RX_OFFLOAD 2022-06-11 17:11:02 +02:00
bittiming.c can: bittiming: move bittiming calculation functions to calc_bittiming.c 2022-06-11 17:11:01 +02:00
calc_bittiming.c can: bittiming: move bittiming calculation functions to calc_bittiming.c 2022-06-11 17:11:01 +02:00
dev.c can: dev: add generic function can_eth_ioctl_hwts() 2022-07-28 11:44:30 +02:00
length.c
netlink.c can: netlink: dump bitrate 0 if can_priv::bittiming.bitrate is -1U 2022-07-03 11:34:24 +02:00
rx-offload.c can: skb: add skb CAN frame data length helpers 2022-09-15 09:08:08 +02:00
skb.c can: dev: fix skb drop check 2022-11-07 14:00:27 +01:00