linux-yocto/drivers/net/ovpn
Ralf Lici 2022d70401 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: 11851cbd60 ("ovpn: implement TCP transport")
Reported-by: Gert Doering <gert@greenie.muc.de>
Closes: https://github.com/OpenVPN/ovpn-net-next/issues/4
Tested-by: Gert Doering <gert@greenie.muc.de>
Signed-off-by: Ralf Lici <ralf@mandelbit.com>
Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
2025-07-16 11:53:19 +02:00
..
bind.c ovpn: implement packet processing 2025-04-17 12:30:02 +02:00
bind.h ovpn: introduce the ovpn_peer object 2025-04-17 12:30:02 +02:00
crypto_aead.c ovpn: fix check for skb_to_sgvec_nomark() return value 2025-05-15 13:09:36 +02:00
crypto_aead.h ovpn: implement key add/get/del/swap via netlink 2025-04-17 12:30:03 +02:00
crypto.c ovpn: kill key and notify userspace in case of IV exhaustion 2025-04-17 12:30:03 +02:00
crypto.h ovpn: kill key and notify userspace in case of IV exhaustion 2025-04-17 12:30:03 +02:00
io.c ovpn: reset GSO metadata after decapsulation 2025-07-16 11:53:19 +02:00
io.h ovpn: implement keepalive mechanism 2025-04-17 12:30:03 +02:00
main.c ovpn: don't drop skb's dst when xmitting packet 2025-05-15 13:09:36 +02:00
main.h
Makefile ovpn: implement TCP transport 2025-04-17 12:30:03 +02:00
netlink-gen.c ovpn: reject unexpected netlink attributes 2025-07-16 11:51:30 +02:00
netlink-gen.h ovpn: reject unexpected netlink attributes 2025-07-16 11:51:30 +02:00
netlink.c ovpn: reject unexpected netlink attributes 2025-07-16 11:51:30 +02:00
netlink.h ovpn: notify userspace when a peer is deleted 2025-04-17 12:30:03 +02:00
ovpnpriv.h ovpn: implement keepalive mechanism 2025-04-17 12:30:03 +02:00
peer.c ovpn: ensure sk is still valid during cleanup 2025-06-03 13:08:15 +02:00
peer.h ovpn: implement peer add/get/dump/delete via netlink 2025-04-17 12:30:03 +02:00
pktid.c ovpn: implement packet processing 2025-04-17 12:30:02 +02:00
pktid.h ovpn: implement packet processing 2025-04-17 12:30:02 +02:00
proto.h ovpn: implement packet processing 2025-04-17 12:30:02 +02:00
skb.h ovpn: add support for MSG_NOSIGNAL in tcp_sendmsg 2025-04-17 12:30:03 +02:00
socket.c ovpn: ensure sk is still valid during cleanup 2025-06-03 13:08:15 +02:00
socket.h ovpn: ensure sk is still valid during cleanup 2025-06-03 13:08:15 +02:00
stats.c ovpn: store tunnel and transport statistics 2025-04-17 12:30:02 +02:00
stats.h ovpn: store tunnel and transport statistics 2025-04-17 12:30:02 +02:00
tcp.c ovpn: avoid sleep in atomic context in TCP RX error path 2025-06-03 13:08:15 +02:00
tcp.h ovpn: ensure sk is still valid during cleanup 2025-06-03 13:08:15 +02:00
udp.c ovpn: propagate socket mark to skb in UDP 2025-07-16 11:50:51 +02:00
udp.h ovpn: ensure sk is still valid during cleanup 2025-06-03 13:08:15 +02:00