From: Sasha Levin Date: Sun, 3 Apr 2022 23:40:51 +0000 (-0400) Subject: Fixes for 5.10 X-Git-Tag: v5.17.2~95 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3ead2bc5f7d35b1f225c20e3d5ef2a5f65a74db7;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 5.10 Signed-off-by: Sasha Levin --- diff --git a/queue-5.10/can-isotp-restore-accidentally-removed-msg_peek-feat.patch b/queue-5.10/can-isotp-restore-accidentally-removed-msg_peek-feat.patch new file mode 100644 index 00000000000..52163e61c12 --- /dev/null +++ b/queue-5.10/can-isotp-restore-accidentally-removed-msg_peek-feat.patch @@ -0,0 +1,48 @@ +From 2750dae9a56fb3450fd29fdaa0e6c09c199595be Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 28 Mar 2022 13:36:11 +0200 +Subject: can: isotp: restore accidentally removed MSG_PEEK feature + +From: Oliver Hartkopp + +[ 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 +Suggested-by: Derek Will +Tested-by: Derek Will +Signed-off-by: Oliver Hartkopp +Signed-off-by: Marc Kleine-Budde +Signed-off-by: Sasha Levin +--- + 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 671c3673b7ea..63e6e8923200 100644 +--- a/net/can/isotp.c ++++ b/net/can/isotp.c +@@ -1007,7 +1007,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 + diff --git a/queue-5.10/series b/queue-5.10/series index 9dd84ce6e49..708b99b9755 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -568,3 +568,4 @@ io_uring-fix-memory-leak-of-uid-in-files-registration.patch riscv-module-remove-noload.patch acpi-cppc-avoid-out-of-bounds-access-when-parsing-_cpc-data.patch platform-chrome-cros_ec_typec-check-for-ec-device.patch +can-isotp-restore-accidentally-removed-msg_peek-feat.patch