Patch "xfrm: Clear low order bits of ->flowi4_tos in decode_session4()." has been added to the 6.7-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

    xfrm: Clear low order bits of ->flowi4_tos in decode_session4().

to the 6.7-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:
     xfrm-clear-low-order-bits-of-flowi4_tos-in-decode_se.patch
and it can be found in the queue-6.7 subdirectory.

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



commit 750f3ca207c7a0624684933ae7122f255dc14afa
Author: Guillaume Nault <gnault@xxxxxxxxxx>
Date:   Wed Jan 3 16:06:32 2024 +0100

    xfrm: Clear low order bits of ->flowi4_tos in decode_session4().
    
    [ Upstream commit 1982a2a02c9197436d4a8ea12f66bafab53f16a0 ]
    
    Commit 23e7b1bfed61 ("xfrm: Don't accidentally set RTO_ONLINK in
    decode_session4()") fixed a problem where decode_session4() could
    erroneously set the RTO_ONLINK flag for IPv4 route lookups. This
    problem was reintroduced when decode_session4() was modified to
    use the flow dissector.
    
    Fix this by clearing again the two low order bits of ->flowi4_tos.
    Found by code inspection, compile tested only.
    
    Fixes: 7a0207094f1b ("xfrm: policy: replace session decode with flow dissector")
    Signed-off-by: Guillaume Nault <gnault@xxxxxxxxxx>
    Signed-off-by: Steffen Klassert <steffen.klassert@xxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index c13dc3ef79107..e69d588caa0c6 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -3416,7 +3416,7 @@ decode_session4(const struct xfrm_flow_keys *flkeys, struct flowi *fl, bool reve
 	}
 
 	fl4->flowi4_proto = flkeys->basic.ip_proto;
-	fl4->flowi4_tos = flkeys->ip.tos;
+	fl4->flowi4_tos = flkeys->ip.tos & ~INET_ECN_MASK;
 }
 
 #if IS_ENABLED(CONFIG_IPV6)




[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