]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Fixes for 5.17
authorSasha Levin <sashal@kernel.org>
Sun, 3 Apr 2022 23:40:49 +0000 (19:40 -0400)
committerSasha Levin <sashal@kernel.org>
Sun, 3 Apr 2022 23:40:49 +0000 (19:40 -0400)
Signed-off-by: Sasha Levin <sashal@kernel.org>
queue-5.17/can-isotp-restore-accidentally-removed-msg_peek-feat.patch [new file with mode: 0644]
queue-5.17/series

diff --git a/queue-5.17/can-isotp-restore-accidentally-removed-msg_peek-feat.patch b/queue-5.17/can-isotp-restore-accidentally-removed-msg_peek-feat.patch
new file mode 100644 (file)
index 0000000..18049aa
--- /dev/null
@@ -0,0 +1,48 @@
+From 7b337c6f0dc275903224bf1e2684cc5bbe25ae0a Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 28 Mar 2022 13:36:11 +0200
+Subject: can: isotp: restore accidentally removed MSG_PEEK feature
+
+From: Oliver Hartkopp <socketcan@hartkopp.net>
+
+[ Upstream commit e382fea8ae54f5bb62869c6b69b33993d43adeca ]
+
+In commit 42bf50a1795a ("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: 42bf50a1795a ("can: isotp: support MSG_TRUNC flag when reading from socket")
+Link: https://github.com/linux-can/can-utils/issues/347#issuecomment-1079554254
+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>
+---
+ 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 ad61342d2e16..a95d171b3a64 100644
+--- a/net/can/isotp.c
++++ b/net/can/isotp.c
+@@ -1009,7 +1009,7 @@ static int isotp_recvmsg(struct socket *sock, struct msghdr *msg, size_t size,
+       int noblock = flags & MSG_DONTWAIT;
+       int ret = 0;
+-      if (flags & ~(MSG_DONTWAIT | MSG_TRUNC))
++      if (flags & ~(MSG_DONTWAIT | MSG_TRUNC | MSG_PEEK))
+               return -EINVAL;
+       if (!so->bound)
+-- 
+2.34.1
+
index 3f15b4667bc44e2a69ca3caca509303d6fa9b35a..662f6d890bd4aed92cd9b065038cfa8ee5d0953b 100644 (file)
@@ -1061,3 +1061,4 @@ vhost-handle-error-while-adding-split-ranges-to-iotlb.patch
 spi-fix-tegra-qspi-example.patch
 platform-chrome-cros_ec_typec-check-for-ec-device.patch
 platform-x86-asus-wmi-fix-regression-when-probing-for-fan-curve-control.patch
+can-isotp-restore-accidentally-removed-msg_peek-feat.patch