Skip to content

Commit 2022d70

Browse files
ralfliciordex
authored andcommitted
ovpn: reset GSO metadata after decapsulation
The ovpn_netdev_write() function is responsible for injecting decapsulated and decrypted packets back into the local network stack. Prior to this patch, the skb could retain GSO metadata from the outer, encrypted tunnel packet. This original GSO metadata, relevant to the sender's transport context, becomes invalid and misleading for the tunnel/data path once the inner packet is exposed. Leaving this stale metadata intact causes internal GSO validation checks further down the kernel's network stack (validate_xmit_skb()) to fail, leading to packet drops. The reasons for these failures vary by protocol, for example: - for ICMP, no offload handler is registered; - for TCP and UDP, the respective offload handlers return errors when comparing skb->len to the outdated skb_shinfo(skb)->gso_size. By calling skb_gso_reset(skb) we ensure the inner packet is presented to gro_cells_receive() with a clean state, correctly indicating it is an individual packet from the perspective of the local stack. This change eliminates the "Driver has suspect GRO implementation, TCP performance may be compromised" warning and improves overall TCP performance by allowing GSO/GRO to function as intended on the decapsulated traffic. Fixes: 11851cb ("ovpn: implement TCP transport") Reported-by: Gert Doering <[email protected]> Closes: OpenVPN/ovpn-net-next#4 Tested-by: Gert Doering <[email protected]> Signed-off-by: Ralf Lici <[email protected]> Signed-off-by: Antonio Quartulli <[email protected]>
1 parent af52020 commit 2022d70

File tree

1 file changed

+7
-0
lines changed
  • drivers/net/ovpn

1 file changed

+7
-0
lines changed

drivers/net/ovpn/io.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,13 @@ static void ovpn_netdev_write(struct ovpn_peer *peer, struct sk_buff *skb)
6262
unsigned int pkt_len;
6363
int ret;
6464

65+
/*
66+
* GSO state from the transport layer is not valid for the tunnel/data
67+
* path. Reset all GSO fields to prevent any further GSO processing
68+
* from entering an inconsistent state.
69+
*/
70+
skb_gso_reset(skb);
71+
6572
/* we can't guarantee the packet wasn't corrupted before entering the
6673
* VPN, therefore we give other layers a chance to check that
6774
*/

0 commit comments

Comments
 (0)