Centos-kernel-stream-9/net
Patrick Talbert f5efc6e19e Merge: tunnels: reset the GSO metadata before reusing the skb
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/7330

JIRA: https://issues.redhat.com/browse/RHEL-101033
Upstream Status: net.git

commit e3c674db356c4303804b2415e7c2b11776cdd8c3
Author: Antoine Tenart <atenart@kernel.org>
Date:   Thu Sep 4 14:53:50 2025 +0200

    tunnels: reset the GSO metadata before reusing the skb

    If a GSO skb is sent through a Geneve tunnel and if Geneve options are
    added, the split GSO skb might not fit in the MTU anymore and an ICMP
    frag needed packet can be generated. In such case the ICMP packet might
    go through the segmentation logic (and dropped) later if it reaches a
    path were the GSO status is checked and segmentation is required.

    This is especially true when an OvS bridge is used with a Geneve tunnel
    attached to it. The following set of actions could lead to the ICMP
    packet being wrongfully segmented:

    1. An skb is constructed by the TCP layer (e.g. gso_type SKB_GSO_TCPV4,
       segs >= 2).

    2. The skb hits the OvS bridge where Geneve options are added by an OvS
       action before being sent through the tunnel.

    3. When the skb is xmited in the tunnel, the split skb does not fit
       anymore in the MTU and iptunnel_pmtud_build_icmp is called to
       generate an ICMP fragmentation needed packet. This is done by reusing
       the original (GSO!) skb. The GSO metadata is not cleared.

    4. The ICMP packet being sent back hits the OvS bridge again and because
       skb_is_gso returns true, it goes through queue_gso_packets...

    5. ...where __skb_gso_segment is called. The skb is then dropped.

    6. Note that in the above example on re-transmission the skb won't be a
       GSO one as it would be segmented (len > MSS) and the ICMP packet
       should go through.

    Fix this by resetting the GSO information before reusing an skb in
    iptunnel_pmtud_build_icmp and iptunnel_pmtud_build_icmpv6.

    Fixes: 4cb47a8644 ("tunnels: PMTU discovery support for directly bridged IP packets")
    Reported-by: Adrian Moreno <amorenoz@redhat.com>
    Signed-off-by: Antoine Tenart <atenart@kernel.org>
    Reviewed-by: Stefano Brivio <sbrivio@redhat.com>
    Link: https://patch.msgid.link/20250904125351.159740-1-atenart@kernel.org
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>

Signed-off-by: Antoine Tenart <atenart@redhat.com>

Approved-by: Sabrina Dubroca <sdubroca@redhat.com>
Approved-by: Guillaume Nault <gnault@redhat.com>
Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com>

Merged-by: Patrick Talbert <ptalbert@redhat.com>
2025-09-20 09:46:13 -04:00
..
6lowpan
9p
802
8021q
appletalk
atm
ax25
batman-adv net: rename netns_local to netns_immutable 2025-06-04 11:17:16 +02:00
bluetooth Merge: CVE-2025-38250: Bluetooth: hci_core: Fix use-after-free in vhci_flush() 2025-08-06 18:26:12 -03:00
bpf bpf, test_run: Fix use-after-free issue in eth_skb_pkt_type() 2025-07-29 18:52:16 +02:00
bpfilter
bridge Merge: CNB97: bridge: update bridge core to upstream v6.15. 2025-07-30 15:15:18 -03:00
caif
can
ceph
core Merge: bpf: stable backports for 9.7 (phase 2) 2025-08-18 17:05:05 -07:00
dcb
dccp
decnet
devlink devlink: let driver opt out of automatic phys_port_name generation 2025-08-28 20:19:14 +02:00
dns_resolver
dsa
ethernet
ethtool ethtool: Block setting of symmetric RSS when non-symmetric rx-flow-hash is requested 2025-08-01 12:52:58 +00:00
handshake
hsr Merge: hsr: stable backports from upstream 2025-06-23 11:03:05 -03:00
ieee802154 net: rename netns_local to netns_immutable 2025-06-04 11:17:16 +02:00
ife
ipv4 tunnels: reset the GSO metadata before reusing the skb 2025-09-10 09:32:43 +02:00
ipv6 ipv6: mcast: Delay put pmc->idev in mld_del_delrec() 2025-08-29 09:41:29 +08:00
iucv
kcm
key
l2tp
l3mdev
lapb
llc
mac80211 Merge: Wireless core and drivers rebase to v6.15 2025-07-15 15:53:43 -03:00
mac802154
mpls
mptcp
ncsi
netfilter netfilter: nf_conntrack: fix crash due to removal of uninitialised entry 2025-09-04 12:28:15 +02:00
netlabel
netlink netlink: fix policy dump for int with validation callback 2025-07-23 15:00:28 +02:00
netrom
nfc
nsh
openvswitch net: openvswitch: remove misbehaving actions length check 2025-08-28 11:00:10 -04:00
packet
phonet
psample
qrtr
rds
rfkill net: rfkill: gpio: allow booting in blocked state 2025-06-17 18:00:35 +02:00
rose
rxrpc
sched Merge: net/sched: ets: use old 'nbands' while purging unused classes 2025-08-19 16:32:50 -07:00
sctp sctp: linearize cloned gso packets in sctp_rcv 2025-09-05 19:37:26 +00:00
shaper
smc net/smc: Fix lookup of netdev by using ib_device_get_netdev() 2025-07-25 16:40:59 +02:00
strparser
sunrpc SUNRPC: call xs_sock_process_cmsg for all cmsg 2025-09-15 14:21:58 -04:00
switchdev net: switchdev: Convert blocking notification chain to a raw one 2025-07-22 16:14:02 +03:00
tipc tipc: Fix use-after-free in tipc_conn_close(). 2025-07-31 10:44:23 +00:00
tls tls: always refresh the queue when reading sock 2025-07-30 12:43:06 +00:00
unix Merge: bpf: stable backports for 9.7 (phase 2) 2025-08-18 17:05:05 -07:00
vmw_vsock hyperv: Switch from hyperv-tlfs.h to hyperv/hvhdk.h 2025-06-10 14:29:58 -04:00
wireless kbuild: use $(src) instead of $(srctree)/$(src) for source directory 2025-08-19 20:06:24 -03:00
x25
xdp Merge: bpf: stable backports for 9.7 (phase 2) 2025-08-18 17:05:05 -07:00
xfrm xfrm: interface: fix use-after-free after changing collect_md xfrm interface 2025-09-02 20:22:21 +00:00
Kconfig
Kconfig.debug
Makefile
compat.c
devres.c
socket.c Merge: CNB97: bridge: update bridge core to upstream v6.15. 2025-07-30 15:15:18 -03:00
sysctl_net.c