Re: [PATCH v2] [RFC] can: fix msg_namelen values depending on CAN_REQUIRED_SIZE
From: Richard Weinberger <richard@nod.at>
Date: 2021-03-25 09:32:14
----- Ursprüngliche Mail -----
Von: "Oliver Hartkopp" [off-list ref] An: "linux-can" [off-list ref] CC: "Oliver Hartkopp" <socketcan@hartkopp.net>, "richard" <richard@nod.at>, "Kurt Van Dijck" [off-list ref] Gesendet: Donnerstag, 25. März 2021 09:13:26 Betreff: [PATCH v2] [RFC] can: 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")
Link:
https://lore.kernel.org/linux-can/1135648123.112255.1616613706554.JavaMail.zimbra@nod.at/T/#t (local)
Reported-by: Richard Weinberger <richard@nod.at>
Suggested-by: Kurt Van Dijck <redacted>
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
---
net/can/bcm.c | 10 ++++++----
net/can/isotp.c | 11 +++++++----
net/can/raw.c | 14 ++++++++------
3 files changed, 21 insertions(+), 14 deletions(-)The patch unbreaks my application. :-) Tested-by: Richard Weinberger <richard@nod.at> Thanks, //richard