]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
can: bcm/raw: fix msg_namelen values depending on CAN_REQUIRED_SIZE
authorOliver Hartkopp <socketcan@hartkopp.net>
Thu, 25 Mar 2021 12:58:48 +0000 (13:58 +0100)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Mon, 29 Mar 2021 07:51:20 +0000 (09:51 +0200)
commit9e9714742fb70467464359693a73b911a630226f
tree01fb923d7e2428470d8abf9a1e4e6b1ff47f9f86
parent1b479fb801602b22512f53c19b1f93a4fc5d5d9d
can: bcm/raw: fix msg_namelen values depending on CAN_REQUIRED_SIZE

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: f5223e9eee65 ("can: extend sockaddr_can to include j1939 members")
Reported-by: Richard Weinberger <richard@nod.at>
Tested-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-1-socketcan@hartkopp.net
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
net/can/bcm.c
net/can/raw.c