summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOliver Hartkopp <socketcan@hartkopp.net>2023-04-06 14:08:45 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-05-24 19:32:49 +0300
commit836641cc41cdce71e9fc957d055426dc4afe2449 (patch)
tree632c286edbf3ffe0e42a0f260cb067615fda1324
parent0eee95cbbbf7ecb422329193e5c381fa47c38d65 (diff)
downloadlinux-836641cc41cdce71e9fc957d055426dc4afe2449.tar.xz
can: j1939: recvmsg(): allow MSG_CMSG_COMPAT flag
commit 1db080cbdbab28752bbb1c86d64daf96253a5da1 upstream. The control message provided by J1939 support MSG_CMSG_COMPAT but blocked recvmsg() syscalls that have set this flag, i.e. on 32bit user space on 64 bit kernels. Link: https://github.com/hartkopp/can-isotp/issues/59 Cc: Oleksij Rempel <o.rempel@pengutronix.de> Suggested-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net> Tested-by: Oleksij Rempel <o.rempel@pengutronix.de> Acked-by: Oleksij Rempel <o.rempel@pengutronix.de> Fixes: 9d71dd0c7009 ("can: add support of SAE J1939 protocol") Link: https://lore.kernel.org/20230505110308.81087-3-mkl@pengutronix.de Cc: stable@vger.kernel.org Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--net/can/j1939/socket.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/can/j1939/socket.c b/net/can/j1939/socket.c
index b670ba03a675..4fb3a99b5f67 100644
--- a/net/can/j1939/socket.c
+++ b/net/can/j1939/socket.c
@@ -798,7 +798,7 @@ static int j1939_sk_recvmsg(struct socket *sock, struct msghdr *msg,
struct j1939_sk_buff_cb *skcb;
int ret = 0;
- if (flags & ~(MSG_DONTWAIT | MSG_ERRQUEUE))
+ if (flags & ~(MSG_DONTWAIT | MSG_ERRQUEUE | MSG_CMSG_COMPAT))
return -EINVAL;
if (flags & MSG_ERRQUEUE)