]> git.baikalelectronics.ru Git - kernel.git/commit
can: isotp: return -EADDRNOTAVAIL when reading from unbound socket
authorOliver Hartkopp <socketcan@hartkopp.net>
Wed, 16 Mar 2022 16:42:57 +0000 (17:42 +0100)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Wed, 16 Mar 2022 20:41:40 +0000 (21:41 +0100)
commit56bde80e653bb618e49b87ebb6f9c3d9fb26d1a4
treef6706cff0e5a3525728b1d34548144ab27302ca0
parent43d03bc09c486a9cb4c4c729cb565ccc170fc075
can: isotp: return -EADDRNOTAVAIL when reading from unbound socket

When reading from an unbound can-isotp socket the syscall blocked
indefinitely. As unbound sockets (without given CAN address information)
do not make sense anyway we directly return -EADDRNOTAVAIL on read()
analogue to the known behavior from sendmsg().

Fixes: 28da5a05c8c3 ("can: add ISO 15765-2:2016 transport protocol")
Link: https://github.com/linux-can/can-utils/issues/349
Link: https://lore.kernel.org/all/20220316164258.54155-2-socketcan@hartkopp.net
Suggested-by: Derek Will <derekrobertwill@gmail.com>
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
net/can/isotp.c