]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
can: isotp: isotp_bind(): do not validate unused address information
authorOliver Hartkopp <socketcan@hartkopp.net>
Tue, 31 Oct 2023 09:30:24 +0000 (10:30 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 8 Nov 2023 16:26:49 +0000 (17:26 +0100)
commitd72ff64783230a15ffdf97222064cf2ac761df24
tree443bfb7f6770c0902f39cafcefb0b1a47c099808
parente163ad6a8639bb28f5aee683f04929cb07dd5990
can: isotp: isotp_bind(): do not validate unused address information

commit b76b163f46b661499921a0049982764a6659bfe7 upstream

With commit 2aa39889c463 ("can: isotp: isotp_bind(): return -EINVAL on
incorrect CAN ID formatting") the bind() syscall returns -EINVAL when
the given CAN ID needed to be sanitized. But in the case of an unconfirmed
broadcast mode the rx CAN ID is not needed and may be uninitialized from
the caller - which is ok.

This patch makes sure the result of an inproper CAN ID format is only
provided when the address information is needed.

Link: https://lore.kernel.org/all/20220517145653.2556-1-socketcan@hartkopp.net
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/can/isotp.c