netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, kuba@kernel.org, linux-can@vger.kernel.org,
	kernel@pengutronix.de, Oliver Hartkopp <socketcan@hartkopp.net>,
	Oleksij Rempel <o.rempel@pengutronix.de>,
	Marc Kleine-Budde <mkl@pengutronix.de>,
	stable@vger.kernel.org
Subject: [PATCH net 1/9] can: isotp: recvmsg(): allow MSG_CMSG_COMPAT flag
Date: Mon, 15 May 2023 22:47:14 +0200	[thread overview]
Message-ID: <20230515204722.1000957-2-mkl@pengutronix.de> (raw)
In-Reply-To: <20230515204722.1000957-1-mkl@pengutronix.de>

From: Oliver Hartkopp <socketcan@hartkopp.net>

The control message provided by isotp 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>
Fixes: 42bf50a1795a ("can: isotp: support MSG_TRUNC flag when reading from socket")
Link: https://lore.kernel.org/20230505110308.81087-2-mkl@pengutronix.de
Cc: stable@vger.kernel.org
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 net/can/isotp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/can/isotp.c b/net/can/isotp.c
index a750259cb79c..84f9aba02901 100644
--- a/net/can/isotp.c
+++ b/net/can/isotp.c
@@ -1139,7 +1139,7 @@ static int isotp_recvmsg(struct socket *sock, struct msghdr *msg, size_t size,
 	struct isotp_sock *so = isotp_sk(sk);
 	int ret = 0;
 
-	if (flags & ~(MSG_DONTWAIT | MSG_TRUNC | MSG_PEEK))
+	if (flags & ~(MSG_DONTWAIT | MSG_TRUNC | MSG_PEEK | MSG_CMSG_COMPAT))
 		return -EINVAL;
 
 	if (!so->bound)

base-commit: df0acdc59b094cdaef19b1c8d83c9721082bab7b
-- 
2.39.2



  reply	other threads:[~2023-05-15 20:47 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-15 20:47 [PATCH net 0/9] pull-request: can 2023-05-15 Marc Kleine-Budde
2023-05-15 20:47 ` Marc Kleine-Budde [this message]
2023-05-17  4:00   ` [PATCH net 1/9] can: isotp: recvmsg(): allow MSG_CMSG_COMPAT flag patchwork-bot+netdevbpf
2023-05-15 20:47 ` [PATCH net 2/9] can: j1939: " Marc Kleine-Budde
2023-05-15 20:47 ` [PATCH net 3/9] can: dev: fix missing CAN XL support in can_put_echo_skb() Marc Kleine-Budde
2023-05-15 20:47 ` [PATCH net 4/9] can: CAN_BXCAN should depend on ARCH_STM32 Marc Kleine-Budde
2023-05-15 20:47 ` [PATCH net 5/9] dt-bindings: net: can: add "st,can-secondary" property Marc Kleine-Budde
2023-05-15 20:47 ` [PATCH net 6/9] ARM: dts: stm32f429: put can2 in secondary mode Marc Kleine-Budde
2023-05-15 20:47 ` [PATCH net 7/9] ARM: dts: stm32: add pin map for CAN controller on stm32f7 Marc Kleine-Budde
2023-05-15 20:47 ` [PATCH net 8/9] can: bxcan: add support for single peripheral configuration Marc Kleine-Budde
2023-05-15 20:47 ` [PATCH net 9/9] ARM: dts: stm32: add CAN support on stm32f746 Marc Kleine-Budde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230515204722.1000957-2-mkl@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=davem@davemloft.net \
    --cc=kernel@pengutronix.de \
    --cc=kuba@kernel.org \
    --cc=linux-can@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=o.rempel@pengutronix.de \
    --cc=socketcan@hartkopp.net \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).