Patch "xfrm: Linearize the skb after offloading if needed." has been added to the 4.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

    xfrm: Linearize the skb after offloading if needed.

to the 4.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:
     xfrm-linearize-the-skb-after-offloading-if-needed.patch
and it can be found in the queue-4.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 e61cfa5af02207fa3e3d8bd51c476e863245529d
Author: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx>
Date:   Wed Jun 14 12:02:02 2023 +0200

    xfrm: Linearize the skb after offloading if needed.
    
    [ Upstream commit f015b900bc3285322029b4a7d132d6aeb0e51857 ]
    
    With offloading enabled, esp_xmit() gets invoked very late, from within
    validate_xmit_xfrm() which is after validate_xmit_skb() validates and
    linearizes the skb if the underlying device does not support fragments.
    
    esp_output_tail() may add a fragment to the skb while adding the auth
    tag/ IV. Devices without the proper support will then send skb->data
    points to with the correct length so the packet will have garbage at the
    end. A pcap sniffer will claim that the proper data has been sent since
    it parses the skb properly.
    
    It is not affected with INET_ESP_OFFLOAD disabled.
    
    Linearize the skb after offloading if the sending hardware requires it.
    It was tested on v4, v6 has been adopted.
    
    Fixes: 7785bba299a8d ("esp: Add a software GRO codepath")
    Signed-off-by: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx>
    Signed-off-by: Steffen Klassert <steffen.klassert@xxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/net/ipv4/esp4_offload.c b/net/ipv4/esp4_offload.c
index 29b333a62ab01..5be59ccb61aa2 100644
--- a/net/ipv4/esp4_offload.c
+++ b/net/ipv4/esp4_offload.c
@@ -268,6 +268,9 @@ static int esp_xmit(struct xfrm_state *x, struct sk_buff *skb,  netdev_features_
 
 	secpath_reset(skb);
 
+	if (skb_needs_linearize(skb, skb->dev->features) &&
+	    __skb_linearize(skb))
+		return -ENOMEM;
 	return 0;
 }
 
diff --git a/net/ipv6/esp6_offload.c b/net/ipv6/esp6_offload.c
index a50d1943dd620..7c72b85c93396 100644
--- a/net/ipv6/esp6_offload.c
+++ b/net/ipv6/esp6_offload.c
@@ -304,6 +304,9 @@ static int esp6_xmit(struct xfrm_state *x, struct sk_buff *skb,  netdev_features
 
 	secpath_reset(skb);
 
+	if (skb_needs_linearize(skb, skb->dev->features) &&
+	    __skb_linearize(skb))
+		return -ENOMEM;
 	return 0;
 }
 



[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