Patch "sctp: subtract sctphdr len in sctp_transport_pl_hlen" has been added to the 5.14-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

    sctp: subtract sctphdr len in sctp_transport_pl_hlen

to the 5.14-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:
     sctp-subtract-sctphdr-len-in-sctp_transport_pl_hlen.patch
and it can be found in the queue-5.14 subdirectory.

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



commit 1f7cbb831bcaec7b5d2fbfb459277fdcb4eafb6e
Author: Xin Long <lucien.xin@xxxxxxxxx>
Date:   Thu Oct 28 05:36:03 2021 -0400

    sctp: subtract sctphdr len in sctp_transport_pl_hlen
    
    [ Upstream commit cc4665ca646c96181a7c00198aa72c59e0c576e8 ]
    
    sctp_transport_pl_hlen() is called to calculate the outer header length
    for PL. However, as the Figure in rfc8899#section-4.4:
    
       Any additional
         headers         .--- MPS -----.
                |        |             |
                v        v             v
         +------------------------------+
         | IP | ** | PL | protocol data |
         +------------------------------+
    
                    <----- PLPMTU ----->
         <---------- PMTU -------------->
    
    Outer header are IP + Any additional headers, which doesn't include
    Packetization Layer itself header, namely sctphdr, whereas sctphdr
    is counted by __sctp_mtu_payload().
    
    The incorrect calculation caused the link pathmtu to be set larger
    than expected by t->pl.pmtu + sctp_transport_pl_hlen(). This patch
    is to fix it by subtracting sctphdr len in sctp_transport_pl_hlen().
    
    Fixes: d9e2e410ae30 ("sctp: add the constants/variables and states and some APIs for transport")
    Signed-off-by: Xin Long <lucien.xin@xxxxxxxxx>
    Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index bc00410223b03..189fdb9db1622 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -626,7 +626,8 @@ static inline __u32 sctp_min_frag_point(struct sctp_sock *sp, __u16 datasize)
 
 static inline int sctp_transport_pl_hlen(struct sctp_transport *t)
 {
-	return __sctp_mtu_payload(sctp_sk(t->asoc->base.sk), t, 0, 0);
+	return __sctp_mtu_payload(sctp_sk(t->asoc->base.sk), t, 0, 0) -
+	       sizeof(struct sctphdr);
 }
 
 static inline void sctp_transport_pl_reset(struct sctp_transport *t)



[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