]> git.proxmox.com Git - mirror_ubuntu-kernels.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)
commit30ffd5332e06316bd69a654c06aa033872979b7c
treef6706cff0e5a3525728b1d34548144ab27302ca0
parent3ea566422cbde9610c2734980d1286ab681bb40e
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: e057dd3fc20f ("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