linux/net/can/j1939
Oleksij Rempel af804b7826 can: j1939: socket: j1939_sk_bind(): make sure ml_priv is allocated
This patch adds check to ensure that the struct net_device::ml_priv is
allocated, as it is used later by the j1939 stack.

The allocation is done by all mainline CAN network drivers, but when using
bond or team devices this is not the case.

Bail out if no ml_priv is allocated.

Reported-by: syzbot+f03d384f3455d28833eb@syzkaller.appspotmail.com
Fixes: 9d71dd0c70 ("can: add support of SAE J1939 protocol")
Cc: linux-stable <stable@vger.kernel.org> # >= v5.4
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Link: https://lore.kernel.org/r/20200807105200.26441-4-o.rempel@pengutronix.de
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2020-08-14 12:38:47 +02:00
..
address-claim.c
bus.c
j1939-priv.h
Kconfig
main.c can: j1939: warn if resources are still linked on destroy 2019-11-13 10:42:34 +01:00
Makefile
socket.c can: j1939: socket: j1939_sk_bind(): make sure ml_priv is allocated 2020-08-14 12:38:47 +02:00
transport.c can: j1939: transport: j1939_session_tx_dat(): fix use-after-free read in j1939_tp_txtimer() 2020-08-14 12:38:47 +02:00