]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
xfrm: bring back device check in validate_xmit_xfrm
authorSabrina Dubroca <sd@queasysnail.net>
Mon, 4 Aug 2025 09:26:26 +0000 (11:26 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Aug 2025 16:40:50 +0000 (18:40 +0200)
[ Upstream commit 65f079a6c446a939eefe71e6d5957d5d6365fcf9 ]

This is partial revert of commit d53dda291bbd993a29b84d358d282076e3d01506.

This change causes traffic using GSO with SW crypto running through a
NIC capable of HW offload to no longer get segmented during
validate_xmit_xfrm, and is unrelated to the bonding use case mentioned
in the commit.

Fixes: d53dda291bbd ("xfrm: Remove unneeded device check from validate_xmit_xfrm")
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Reviewed-by: Cosmin Ratiu <cratiu@nvidia.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/xfrm/xfrm_device.c

index 1f88472aaac0afe7e23d68b86b9e7607ac4e4d54..c7a1f080d2de3a19de9db7fa25c7b1355b3dbe5d 100644 (file)
@@ -155,7 +155,8 @@ struct sk_buff *validate_xmit_xfrm(struct sk_buff *skb, netdev_features_t featur
                return skb;
        }
 
-       if (skb_is_gso(skb) && unlikely(xmit_xfrm_check_overflow(skb))) {
+       if (skb_is_gso(skb) && (unlikely(x->xso.dev != dev) ||
+                               unlikely(xmit_xfrm_check_overflow(skb)))) {
                struct sk_buff *segs;
 
                /* Packet got rerouted, fixup features and segment it. */