linux-stable/net/can
Oliver Hartkopp fcc63f2f7e can: af_can: fix NULL pointer dereference in can_rcv_filter
commit 0acc442309 upstream.

Analogue to commit 8aa59e3559 ("can: af_can: fix NULL pointer
dereference in can_rx_register()") we need to check for a missing
initialization of ml_priv in the receive path of CAN frames.

Since commit 4e096a1886 ("net: introduce CAN specific pointer in the
struct net_device") the check for dev->type to be ARPHRD_CAN is not
sufficient anymore since bonding or tun netdevices claim to be CAN
devices but do not initialize ml_priv accordingly.

Fixes: 4e096a1886 ("net: introduce CAN specific pointer in the struct net_device")
Reported-by: syzbot+2d7f58292cb5b29eb5ad@syzkaller.appspotmail.com
Reported-by: Wei Chen <harperchen1110@gmail.com>
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Link: https://lore.kernel.org/all/20221206201259.3028-1-socketcan@hartkopp.net
Cc: stable@vger.kernel.org
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-12-14 11:40:56 +01:00
..
j1939 can: j1939: j1939_send_one(): fix missing CAN header initialization 2022-11-16 10:04:10 +01:00
Kconfig net: Kconfig: move the CAN device menu to the "Device Drivers" section 2022-06-11 17:11:02 +02:00
Makefile can: add ISO 15765-2:2016 transport protocol 2020-10-07 23:18:33 +02:00
af_can.c can: af_can: fix NULL pointer dereference in can_rcv_filter 2022-12-14 11:40:56 +01:00
af_can.h can: introduce CAN midlayer private and allocate it automatically 2019-09-04 13:29:14 +02:00
bcm.c can: bcm: check the result of can_send() in bcm_can_tx() 2022-10-21 12:39:10 +02:00
gw.c can: gw: use call_rcu() instead of costly synchronize_rcu() 2022-02-24 08:26:03 +01:00
isotp.c can: isotp: fix tx state handling for echo tx processing 2022-11-16 10:04:10 +01:00
proc.c proc: remove PDE_DATA() completely 2022-01-22 08:33:37 +02:00
raw.c can: raw: add support for SO_TXTIME/SCM_TXTIME 2022-05-16 22:03:45 +02:00