WSL2-Linux-Kernel/drivers/net/can/c_can
Tong Zhang 644d0a5bcc can: c_can: fix null-ptr-deref on ioctl()
The pdev maybe not a platform device, e.g. c_can_pci device, in this
case, calling to_platform_device() would not make sense. Also, per the
comment in drivers/net/can/c_can/c_can_ethtool.c, @bus_info should
match dev_name() string, so I am replacing this with dev_name() to fix
this issue.

[    1.458583] BUG: unable to handle page fault for address: 0000000100000000
[    1.460921] RIP: 0010:strnlen+0x1a/0x30
[    1.466336]  ? c_can_get_drvinfo+0x65/0xb0 [c_can]
[    1.466597]  ethtool_get_drvinfo+0xae/0x360
[    1.466826]  dev_ethtool+0x10f8/0x2970
[    1.467880]  sock_ioctl+0xef/0x300

Fixes: 2722ac986e ("can: c_can: add ethtool support")
Link: https://lore.kernel.org/r/20210906233704.1162666-1-ztong0001@gmail.com
Cc: stable@vger.kernel.org # 5.14+
Signed-off-by: Tong Zhang <ztong0001@gmail.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2021-09-07 08:46:58 +02:00
..
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
Makefile can: c_can: add ethtool support 2021-05-27 09:42:23 +02:00
c_can.h can: c_can: cache frames to operate as a true FIFO 2021-08-19 15:07:06 +02:00
c_can_ethtool.c can: c_can: fix null-ptr-deref on ioctl() 2021-09-07 08:46:58 +02:00
c_can_main.c can: c_can: cache frames to operate as a true FIFO 2021-08-19 15:07:06 +02:00
c_can_pci.c can: c_can: add support to 64 message objects 2021-03-30 11:14:53 +02:00
c_can_platform.c can: c_can: remove struct c_can_priv::priv field 2021-08-19 15:07:05 +02:00