Centos-kernel-stream-9/net
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
..
6lowpan
9p
802
8021q
appletalk
atm net: change proto and proto_ops accept type 2024-12-02 11:12:33 -05:00
ax25 net: change proto and proto_ops accept type 2024-12-02 11:12:33 -05:00
batman-adv genetlink: remove linux/genetlink.h 2024-12-10 10:37:53 +01:00
bluetooth Merge: CVE-2024-53208: Bluetooth: MGMT: Fix slab-use-after-free Read in set_powered_sync 2025-02-07 09:54:24 -05:00
bpf Merge: io_uring: Update to upstream v6.10 + fixes 2025-01-13 18:58:47 +00:00
bpfilter
bridge Merge: CNB96: bridge: update bridge core to upstream v6.12 2024-12-10 14:32:15 +00:00
caif
can can: raw: raw_getsockopt(): reduce scope of err 2025-03-19 15:14:54 -04:00
ceph
core Merge: CVE-2025-21806: net: let net.core.dev_weight always be non-zero 2025-04-24 12:23:26 -03:00
dcb
dccp net: fix data-races around sk->sk_forward_alloc 2024-12-02 14:40:01 +00:00
decnet
devlink Merge: CNB96: netlink/devlink: update devlink & netlink to the v6.12 2024-12-30 07:30:10 -05:00
dns_resolver
dsa
ethernet
ethtool
handshake
hsr treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_30.RULE (part 2) 2024-11-27 09:40:24 +08:00
ieee802154 net: ieee802154: do not leave a dangling sk pointer in ieee802154_create() 2025-01-15 17:26:25 +01:00
ife
ipv4 Merge: net: gso: fix ownership in __udp_gso_segment 2025-04-24 12:23:29 -03:00
ipv6 ipv6: use RCU protection in ip6_default_advmss() 2025-03-28 13:24:25 +01:00
iucv s390/iucv: MSG_PEEK causes memory leak in iucv_sock_destruct() 2025-01-17 17:09:14 +01:00
kcm
key
l2tp genetlink: hold RCU in genlmsg_mcast() 2024-12-10 10:37:56 +01:00
l3mdev
lapb
llc net: change proto and proto_ops accept type 2024-12-02 11:12:33 -05:00
mac80211 wifi: cfg80211: clear link ID from bitmap during link delete after clean up 2025-01-15 17:26:26 +01:00
mac802154
mpls mpls: Handle error of rtnl_register_module(). 2025-04-01 14:56:36 +02:00
mptcp mptcp: fix tracking issue in mptcp_subflow_create_socket() 2025-01-31 06:45:48 -05:00
ncsi
netfilter netfilter: nft_exthdr: fix offset with ipv4_find_option() 2025-03-26 11:19:46 +01:00
netlabel
netlink net: add a refcount tracker for kernel sockets 2025-01-31 06:45:48 -05:00
netrom net: change proto and proto_ops accept type 2024-12-02 11:12:33 -05:00
nfc net: change proto and proto_ops accept type 2024-12-02 11:12:33 -05:00
nsh
openvswitch Merge: net: visibility patches for 9.6 2025-01-06 08:26:06 +00:00
packet af_packet: do not call packet_read_pending() from tpacket_destruct_skb() 2025-02-07 13:57:37 +00:00
phonet net: change proto and proto_ops accept type 2024-12-02 11:12:33 -05:00
psample
qrtr net: qrtr: Update packets cloning when broadcasting 2024-11-22 10:58:17 +01:00
rds net: change proto and proto_ops accept type 2024-12-02 11:12:33 -05:00
rfkill finally take no_llseek out 2024-11-22 10:58:17 +01:00
rose net: change proto and proto_ops accept type 2024-12-02 11:12:33 -05:00
rxrpc rxrpc: Fix a race between socket set up and I/O thread creation 2025-02-27 12:05:03 -04:00
sched pfifo_tail_enqueue: Drop new packet when sch->limit == 0 2025-02-18 15:35:45 +00:00
sctp Merge: sctp backports from upstream, 2nd phase 2025-01-23 13:15:19 +00:00
smc Merge: [s390] net/smc: fix spurious error message from __sock_release() 2025-03-06 00:01:01 -03:00
strparser
sunrpc SUNRPC: Handle -ETIMEDOUT return from tlshd 2025-02-27 09:31:26 -05:00
switchdev
tipc Merge: tipc: Fix use-after-free of kernel socket in cleanup_bearer(). 2025-01-23 13:15:18 +00:00
tls Revert "net/tls: fix tls_sk_proto_close executed repeatedly" 2025-01-31 06:45:39 -05:00
unix net: change proto and proto_ops accept type 2024-12-02 11:12:33 -05:00
vmw_vsock Merge: CVE-2025-21669: vsock/virtio: discard packets if the transport changes 2025-02-17 12:00:35 -05:00
wireless Merge: CVE-2024-56663: wifi: nl80211: fix NL80211_ATTR_MLO_LINK_ID off-by-one 2025-02-10 03:47:14 -05:00
x25 net: change proto and proto_ops accept type 2024-12-02 11:12:33 -05:00
xdp xsk: Free skb when TX metadata options are invalid 2025-01-09 17:43:24 +01:00
xfrm xfrm: Export symbol xfrm_dev_state_delete. 2025-01-24 18:29:47 +01:00
Kconfig net/core: Enable socket busy polling on -RT 2024-11-28 15:37:44 -05:00
Kconfig.debug
Makefile
compat.c
devres.c
socket.c net: have do_accept() take a struct proto_accept_arg argument 2024-12-02 11:12:47 -05:00
sysctl_net.c