1
0
Fork 0
alistair23-linux/net/can
Oleksij Rempel 143df6b358 can: j1939: socket: j1939_sk_bind(): make sure ml_priv is allocated
commit af804b7826 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-08-26 10:40:50 +02:00
..
j1939 can: j1939: socket: j1939_sk_bind(): make sure ml_priv is allocated 2020-08-26 10:40:50 +02:00
Kconfig can: add support of SAE J1939 protocol 2019-09-04 14:22:33 +02:00
Makefile can: add support of SAE J1939 protocol 2019-09-04 14:22:33 +02:00
af_can.c can: af_can: export can_sock_destruct() 2019-11-13 10:42:33 +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: introduce CAN_REQUIRED_SIZE macro 2019-09-04 13:29:15 +02:00
gw.c can: gw: add support for CAN FD frames 2019-08-13 17:32:21 +02:00
proc.c can: introduce CAN midlayer private and allocate it automatically 2019-09-04 13:29:14 +02:00
raw.c can: introduce CAN_REQUIRED_SIZE macro 2019-09-04 13:29:15 +02:00