Centos-kernel-stream-9/net/ipv4
Augusto Caringi be616bbd8e Merge: net: gso: fix ownership in __udp_gso_segment
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/6516

JIRA: https://issues.redhat.com/browse/RHEL-33329
Upstream Status: net.git
CVE: CVE-2025-21926

commit ee01b2f2d7d0010787c2343463965bbc283a497f
Author: Antoine Tenart <atenart@kernel.org>
Date:   Wed Feb 26 18:13:42 2025 +0100

    net: gso: fix ownership in __udp_gso_segment

    In __udp_gso_segment the skb destructor is removed before segmenting the
    skb but the socket reference is kept as-is. This is an issue if the
    original skb is later orphaned as we can hit the following bug:

      kernel BUG at ./include/linux/skbuff.h:3312!  (skb_orphan)
      RIP: 0010:ip_rcv_core+0x8b2/0xca0
      Call Trace:
       ip_rcv+0xab/0x6e0
       __netif_receive_skb_one_core+0x168/0x1b0
       process_backlog+0x384/0x1100
       __napi_poll.constprop.0+0xa1/0x370
       net_rx_action+0x925/0xe50

    The above can happen following a sequence of events when using
    OpenVSwitch, when an OVS_ACTION_ATTR_USERSPACE action precedes an
    OVS_ACTION_ATTR_OUTPUT action:

    1. OVS_ACTION_ATTR_USERSPACE is handled (in do_execute_actions): the skb
       goes through queue_gso_packets and then __udp_gso_segment, where its
       destructor is removed.
    2. The segments' data are copied and sent to userspace.
    3. OVS_ACTION_ATTR_OUTPUT is handled (in do_execute_actions) and the
       same original skb is sent to its path.
    4. If it later hits skb_orphan, we hit the bug.

    Fix this by also removing the reference to the socket in
    __udp_gso_segment.

    Fixes: ad405857b1 ("udp: better wmem accounting on gso")
    Signed-off-by: Antoine Tenart <atenart@kernel.org>
    Link: https://patch.msgid.link/20250226171352.258045-1-atenart@kernel.org
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

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

Approved-by: Hangbin Liu <haliu@redhat.com>
Approved-by: Xin Long <lxin@redhat.com>
Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com>

Merged-by: Augusto Caringi <acaringi@redhat.com>
2025-04-24 12:23:29 -03:00
..
bpfilter
netfilter netfilter: fib: check correct rtable in vrf setups 2025-01-13 15:04:38 +00:00
Kconfig
Makefile net: fou: use policy and operation tables generated from the spec 2024-04-02 11:15:39 +02:00
af_inet.c Merge: CVE-2024-56601: net: inet: do not leave a dangling sk pointer in inet_create() 2025-01-14 14:18:41 +00:00
ah4.c
arp.c arp: Convert ioctl(SIOCGARP) to RCU. 2024-11-29 10:54:26 +01:00
bpf_tcp_ca.c bpf: Check unsupported ops from the bpf_struct_ops's cfi_stubs 2025-01-13 17:36:13 +01:00
cipso_ipv4.c cipso: make cipso_v4_skbuff_delattr() fully remove the CIPSO options 2024-06-20 17:48:52 +02:00
datagram.c
devinet.c ipv4: give an IPv4 dev to blackhole_netdev 2025-01-09 18:01:35 +01:00
esp4.c page_pool: check for PP direct cache locality later 2024-11-06 18:18:24 +01:00
esp4_offload.c net: move gso declarations and functions to their own files 2023-10-11 13:35:27 +02:00
fib_frontend.c netlink: let core handle error cases in dump operations 2024-12-10 10:37:52 +01:00
fib_lookup.h
fib_notifier.c
fib_rules.c
fib_semantics.c ipv4: fix source address selection with route leak 2024-10-02 21:02:45 +02:00
fib_trie.c inet: switch inet_dump_fib() to RCU protection 2024-10-24 16:14:43 +02:00
fou_core.c net: gro: skb_gro_header helper function 2024-05-17 11:06:42 +02:00
fou_nl.c net: ynl: prefix uAPI header include with uapi/ 2024-04-10 09:19:21 +02:00
fou_nl.h net: ynl: prefix uAPI header include with uapi/ 2024-04-10 09:19:21 +02:00
gre_demux.c ip_tunnel: convert __be16 tunnel flags to bitmaps 2024-06-12 14:49:18 +02:00
gre_offload.c net: gro: skb_gro_header helper function 2024-05-17 11:06:42 +02:00
icmp.c net: Fix icmp host relookup triggering ip_rt_bug 2025-01-07 10:56:26 +08:00
igmp.c inet: annotate devconf data-races 2024-11-14 10:16:47 +01:00
inet_connection_sock.c Merge: io_uring: Update to upstream v6.10 + fixes 2025-01-13 18:58:47 +00:00
inet_diag.c inet_diag: Initialize pad field in struct inet_diag_req_v2 2024-10-02 21:02:42 +02:00
inet_fragment.c inet: inet_defrag: prevent sk release while still in use 2024-04-09 18:25:31 +02:00
inet_hashtables.c net: set SOCK_RCU_FREE before inserting socket into hashtable 2024-01-19 14:08:46 +01:00
inet_timewait_sock.c tcp: move inet_twsk_schedule helper out of header 2024-08-21 16:58:19 +02:00
inetpeer.c
ip_forward.c net: ipv4, ipv6: fix IPSTATS_MIB_OUTOCTETS increment duplicated 2023-12-11 11:15:48 +01:00
ip_fragment.c inet: inet_defrag: prevent sk release while still in use 2024-04-09 18:25:31 +02:00
ip_gre.c Merge: tunnels: backports from upstream 2024-11-05 11:40:17 +00:00
ip_input.c ipv4: ignore dst hint for multipath routes 2024-10-02 21:02:30 +02:00
ip_options.c
ip_output.c inet: preserve const qualifier in inet_sk() 2024-07-16 17:29:40 +02:00
ip_sockglue.c ipv{4,6}/raw: fix output xfrm lookup wrt protocol 2024-04-02 17:49:05 +08:00
ip_tunnel.c net: Fix netns for ip_tunnel_init_flow() 2025-01-09 18:01:58 +01:00
ip_tunnel_core.c ip_tunnel: convert __be16 tunnel flags to bitmaps 2024-06-12 14:49:18 +02:00
ip_vti.c netdev_features: convert NETIF_F_LLTX to dev->lltx 2024-10-03 17:59:44 +02:00
ipcomp.c
ipconfig.c
ipip.c netdev_features: convert NETIF_F_LLTX to dev->lltx 2024-10-03 17:59:44 +02:00
ipmr.c inet: allow ip_valid_fib_dump_req() to be called with RTNL or RCU 2024-10-24 16:14:43 +02:00
ipmr_base.c
metrics.c
netfilter.c
netlink.c
nexthop.c net: nexthop: Increase weight to u16 2024-11-20 19:02:15 +01:00
ping.c Merge: ping: fix address binding wrt vrf 2024-09-13 06:53:30 +00:00
proc.c Merge: USB/TBT code rebase of supported drivers to upstream v6.11 2024-11-25 13:17:44 +00:00
protocol.c
raw.c net: raw: use sk_skb_reason_drop to free rx packets 2024-07-16 17:29:42 +02:00
raw_diag.c raw: Fix NULL deref in raw_get_next(). 2023-07-07 12:23:40 +02:00
route.c inet: annotate devconf data-races 2024-11-14 10:16:47 +01:00
syncookies.c tcp: use sk_skb_reason_drop to free rx packets 2024-07-16 17:29:42 +02:00
sysctl_net_ipv4.c net: ipv4: Add a sysctl to set multipath hash seed 2024-09-24 17:04:46 +02:00
tcp.c bpf: Add bpf_sock_destroy kfunc 2025-01-28 12:51:54 +01:00
tcp_bbr.c bpf: treewide: Annotate BPF kfuncs in BTF 2024-10-15 10:49:07 +02:00
tcp_bic.c
tcp_bpf.c tcp_bpf: fix return value of tcp_bpf_sendmsg() 2025-01-09 11:58:42 +01:00
tcp_cdg.c treewide: use get_random_u32() when possible 2023-10-20 06:15:03 -04:00
tcp_cong.c bpf, net: validate struct_ops when updating value. 2024-10-15 10:49:12 +02:00
tcp_cubic.c bpf: treewide: Annotate BPF kfuncs in BTF 2024-10-15 10:49:07 +02:00
tcp_dctcp.c bpf: treewide: Annotate BPF kfuncs in BTF 2024-10-15 10:49:07 +02:00
tcp_dctcp.h
tcp_diag.c
tcp_fastopen.c tcp: drop secpath at the same time as we currently drop dst 2025-03-20 10:11:45 +01:00
tcp_highspeed.c
tcp_htcp.c
tcp_hybla.c
tcp_illinois.c
tcp_input.c tcp: drop secpath at the same time as we currently drop dst 2025-03-20 10:11:45 +01:00
tcp_ipv4.c tcp: drop secpath at the same time as we currently drop dst 2025-03-20 10:11:45 +01:00
tcp_lp.c
tcp_metrics.c tcp_metrics: validate source addr length 2024-08-07 14:24:46 +02:00
tcp_minisocks.c Merge: mptcp: phase-1 backports for RHEL-9.6 2024-11-22 09:18:31 +00:00
tcp_nv.c
tcp_offload.c net: drop bad gso csum_start and offset in virtio_net_hdr 2024-09-05 13:58:27 +02:00
tcp_output.c tcp: fix excessive TLP and RACK timeouts from HZ rounding 2025-03-14 13:21:38 +00:00
tcp_rate.c
tcp_recovery.c tcp: fix excessive TLP and RACK timeouts from HZ rounding 2025-03-14 13:21:38 +00:00
tcp_scalable.c
tcp_timer.c Merge: mptcp: phase-1 backports for RHEL-9.6 2024-11-22 09:18:31 +00:00
tcp_ulp.c
tcp_vegas.c
tcp_vegas.h
tcp_veno.c
tcp_westwood.c
tcp_yeah.c
tunnel4.c
udp.c bpf: Add bpf_sock_destroy kfunc 2025-01-28 12:51:54 +01:00
udp_bpf.c bpf, sockmap: Fix an infinite loop error when len is 0 in tcp_bpf_recvmsg_parser() 2023-06-14 10:44:28 +02:00
udp_diag.c udp: Access &udp_table via net. 2025-01-28 12:51:53 +01:00
udp_impl.h
udp_offload.c net: gso: fix ownership in __udp_gso_segment 2025-04-23 15:54:51 +02:00
udp_tunnel_core.c ip_tunnel: convert __be16 tunnel flags to bitmaps 2024-06-12 14:49:18 +02:00
udp_tunnel_nic.c
udp_tunnel_stub.c
udplite.c udplite: Fix NULL pointer dereference in __sk_mem_raise_allocated(). 2023-06-26 16:09:44 +02:00
xfrm4_input.c xfrm: Preserve vlan tags for transport mode software GRO 2024-10-30 11:47:57 +01:00
xfrm4_output.c
xfrm4_policy.c net: dst: fix missing initialization of rt_uncached 2024-05-21 17:19:20 +02:00
xfrm4_protocol.c
xfrm4_state.c
xfrm4_tunnel.c