Patch "can: isotp: restore accidentally removed MSG_PEEK feature" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    can: isotp: restore accidentally removed MSG_PEEK feature

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     can-isotp-restore-accidentally-removed-msg_peek-feat.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 5fb9014ec8aa2a7df296312c8d8adc52bda8a2ba
Author: Oliver Hartkopp <socketcan@xxxxxxxxxxxx>
Date:   Mon Mar 28 13:36:11 2022 +0200

    can: isotp: restore accidentally removed MSG_PEEK feature
    
    [ 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@xxxxxxxxxxxx
    Reported-by: Derek Will <derekrobertwill@xxxxxxxxx>
    Suggested-by: Derek Will <derekrobertwill@xxxxxxxxx>
    Tested-by: Derek Will <derekrobertwill@xxxxxxxxx>
    Signed-off-by: Oliver Hartkopp <socketcan@xxxxxxxxxxxx>
    Signed-off-by: Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

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)



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux