Skip to content

Commit 90ec1b1

Browse files
hartkoppgregkh
authored andcommitted
can: isotp: restore accidentally removed MSG_PEEK feature
[ Upstream commit e382fea ] In commit 42bf50a ("can: isotp: support MSG_TRUNC flag when reading from socket") a new check for recvmsg flags has been introduced that only checked for the flags that are handled in isotp_recvmsg() itself. This accidentally removed the MSG_PEEK feature flag which is processed later in the call chain in __skb_try_recv_from_queue(). Add MSG_PEEK to the set of valid flags to restore the feature. Fixes: 42bf50a ("can: isotp: support MSG_TRUNC flag when reading from socket") Link: linux-can/can-utils#347 (comment) Link: https://lore.kernel.org/all/20220328113611.3691-1-socketcan@hartkopp.net Reported-by: Derek Will <derekrobertwill@gmail.com> Suggested-by: Derek Will <derekrobertwill@gmail.com> Tested-by: Derek Will <derekrobertwill@gmail.com> 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>
1 parent 16960ac commit 90ec1b1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

net/can/isotp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1007,7 +1007,7 @@ static int isotp_recvmsg(struct socket *sock, struct msghdr *msg, size_t size,
10071007
int noblock = flags & MSG_DONTWAIT;
10081008
int ret = 0;
10091009

1010-
if (flags & ~(MSG_DONTWAIT | MSG_TRUNC))
1010+
if (flags & ~(MSG_DONTWAIT | MSG_TRUNC | MSG_PEEK))
10111011
return -EINVAL;
10121012

10131013
if (!so->bound)

0 commit comments

Comments
 (0)