]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
can: isotp: fix msg_namelen values depending on CAN_REQUIRED_SIZE
authorOliver Hartkopp <socketcan@hartkopp.net>
Thu, 25 Mar 2021 12:58:49 +0000 (13:58 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Apr 2021 06:47:18 +0000 (08:47 +0200)
commit84e55cd73e981b89cb4ce956f16d4a4507ed01a3
treecdd7e4578304558b3f5933efecaa51cbd72848e1
parentcf9a8a13c8ba356698c1999a9a18ef6eb2245e81
can: isotp: fix msg_namelen values depending on CAN_REQUIRED_SIZE

[ Upstream commit f522d9559b07854c231cf8f0b8cb5a3578f8b44e ]

Since commit f5223e9eee65 ("can: extend sockaddr_can to include j1939
members") the sockaddr_can has been extended in size and a new
CAN_REQUIRED_SIZE macro has been introduced to calculate the protocol
specific needed size.

The ABI for the msg_name and msg_namelen has not been adapted to the
new CAN_REQUIRED_SIZE macro for the other CAN protocols which leads to
a problem when an existing binary reads the (increased) struct
sockaddr_can in msg_name.

Fixes: e057dd3fc20f ("can: add ISO 15765-2:2016 transport protocol")
Reported-by: Richard Weinberger <richard@nod.at>
Acked-by: Kurt Van Dijck <dev.kurt@vandijck-laurijssen.be>
Link: https://lore.kernel.org/linux-can/1135648123.112255.1616613706554.JavaMail.zimbra@nod.at/T/#t
Link: https://lore.kernel.org/r/20210325125850.1620-2-socketcan@hartkopp.net
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/can/isotp.c