Patch "can: isotp: isotp_setsockopt(): only allow to set low level TX flags for CAN-FD" has been added to the 5.10-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: isotp_setsockopt(): only allow to set low level TX flags for CAN-FD

to the 5.10-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-isotp_setsockopt-only-allow-to-set-low-lev.patch
and it can be found in the queue-5.10 subdirectory.

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



commit b20e027d3a6a745c9a296eca32ba58a7877cde5c
Author: Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx>
Date:   Thu Feb 18 21:58:36 2021 +0100

    can: isotp: isotp_setsockopt(): only allow to set low level TX flags for CAN-FD
    
    [ Upstream commit e4912459bd5edd493b61bc7c3a5d9b2eb17f5a89 ]
    
    CAN-FD frames have struct canfd_frame::flags, while classic CAN frames
    don't.
    
    This patch refuses to set TX flags (struct
    can_isotp_ll_options::tx_flags) on non CAN-FD isotp sockets.
    
    Fixes: e057dd3fc20f ("can: add ISO 15765-2:2016 transport protocol")
    Link: https://lore.kernel.org/r/20210218215434.1708249-2-mkl@xxxxxxxxxxxxxx
    Cc: 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 8bd565f2073e..a9b96a6e6317 100644
--- a/net/can/isotp.c
+++ b/net/can/isotp.c
@@ -1212,7 +1212,8 @@ static int isotp_setsockopt(struct socket *sock, int level, int optname,
 			if (ll.mtu != CAN_MTU && ll.mtu != CANFD_MTU)
 				return -EINVAL;
 
-			if (ll.mtu == CAN_MTU && ll.tx_dl > CAN_MAX_DLEN)
+			if (ll.mtu == CAN_MTU &&
+			    (ll.tx_dl > CAN_MAX_DLEN || ll.tx_flags != 0))
 				return -EINVAL;
 
 			memcpy(&so->ll, &ll, sizeof(ll));



[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