linux-stable/net/can
Oliver Hartkopp dd4faace51 can: isotp: check CAN address family in isotp_bind()
[ Upstream commit c6adf659a8 ]

Add missing check to block non-AF_CAN binds.

Syzbot created some code which matched the right sockaddr struct size
but used AF_XDP (0x2C) instead of AF_CAN (0x1D) in the address family
field:

bind$xdp(r2, &(0x7f0000000540)={0x2c, 0x0, r4, 0x0, r2}, 0x10)
                                ^^^^
This has no funtional impact but the userspace should be notified about
the wrong address family field content.

Link: https://syzkaller.appspot.com/text?tag=CrashLog&x=11ff9d8c480000
Reported-by: syzbot+5aed6c3aaba661f5b917@syzkaller.appspotmail.com
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Link: https://lore.kernel.org/all/20230104201844.13168-1-socketcan@hartkopp.net
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-03-10 09:29:11 +01:00
..
j1939 can: j1939: do not wait 250 ms if the same addr was already claimed 2023-02-07 15:00:22 +01:00
af_can.c net: af_can: remove useless parameter 'err' in 'can_rx_register()' 2022-12-12 11:41:24 +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-09-23 13:53:10 +02:00
gw.c can: skb: unify skb CAN frame identification helpers 2022-09-15 09:08:08 +02:00
isotp.c can: isotp: check CAN address family in isotp_bind() 2023-03-10 09:29:11 +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
proc.c proc: remove PDE_DATA() completely 2022-01-22 08:33:37 +02:00
raw.c can: raw: fix CAN FD frame transmissions over CAN XL devices 2023-02-02 10:33:26 +01:00