linux-stable/net/core
Antoine Tenart 2eeab8c47c gro: fix ownership transfer
commit ed4cccef64 upstream.

If packets are GROed with fraglist they might be segmented later on and
continue their journey in the stack. In skb_segment_list those skbs can
be reused as-is. This is an issue as their destructor was removed in
skb_gro_receive_list but not the reference to their socket, and then
they can't be orphaned. Fix this by also removing the reference to the
socket.

For example this could be observed,

  kernel BUG at include/linux/skbuff.h:3131!  (skb_orphan)
  RIP: 0010:ip6_rcv_core+0x11bc/0x19a0
  Call Trace:
   ipv6_list_rcv+0x250/0x3f0
   __netif_receive_skb_list_core+0x49d/0x8f0
   netif_receive_skb_list_internal+0x634/0xd40
   napi_complete_done+0x1d2/0x7d0
   gro_cell_poll+0x118/0x1f0

A similar construction is found in skb_gro_receive, apply the same
change there.

Fixes: 5e10da5385 ("skbuff: allow 'slow_gro' for skb carring sock reference")
Signed-off-by: Antoine Tenart <atenart@kernel.org>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-04-10 16:28:26 +02:00
..
Makefile devlink: move code to a dedicated directory 2023-08-30 16:11:00 +02:00
bpf_sk_storage.c bpf: Add length check for SK_DIAG_BPF_STORAGE_REQ_MAP_FD parsing 2023-08-11 12:08:12 +02:00
datagram.c
dev.c net: report RCU QS on threaded NAPI repolling 2024-03-26 18:21:02 -04:00
dev.h net: fix removing a namespace with conflicting altnames 2024-01-31 16:17:04 -08:00
dev_addr_lists.c
dev_addr_lists_test.c
dev_ioctl.c net: dev: Convert sa_data to flexible array in struct sockaddr 2024-03-01 13:26:36 +01:00
drop_monitor.c drop_monitor: Require 'CAP_SYS_ADMIN' when joining "events" group 2023-12-13 18:39:12 +01:00
dst.c ipv6: remove max_size check inline with ipv4 2024-01-15 18:54:51 +01:00
dst_cache.c
failover.c
fib_notifier.c
fib_rules.c
filter.c bpf: Derive source IP addr via bpf_*_fib_lookup() 2024-03-06 14:45:20 +00:00
flow_dissector.c net/core: Fix ETH_P_1588 flow dissector 2023-10-06 14:56:36 +02:00
flow_offload.c
gen_estimator.c
gen_stats.c
gro.c gro: fix ownership transfer 2024-04-10 16:28:26 +02:00
gro_cells.c
hwbm.c
link_watch.c
lwt_bpf.c lwt: Fix return values of BPF xmit ops 2023-09-13 09:42:33 +02:00
lwtunnel.c
neighbour.c neighbour: Don't let neigh_forced_gc() disable preemption for long 2024-01-20 11:50:07 +01:00
net-procfs.c
net-sysfs.c
net-sysfs.h
net-traces.c
net_namespace.c
netclassid_cgroup.c
netevent.c
netpoll.c
netprio_cgroup.c
of_net.c
page_pool.c net: page_pool: add missing free_percpu when page_pool_init fail 2023-11-20 11:52:16 +01:00
pktgen.c net: pktgen: Fix interface flags printing 2023-10-25 12:03:08 +02:00
ptp_classifier.c
request_sock.c tcp: make sure init the accept_queue's spinlocks once 2024-01-31 16:17:03 -08:00
rtnetlink.c rtnetlink: fix error logic of IFLA_BRIDGE_FLAGS writing back 2024-03-06 14:45:08 +00:00
scm.c io_uring/unix: drop usage of io_uring socket 2024-03-26 18:20:22 -04:00
secure_seq.c
selftests.c
skbuff.c net: mctp: copy skb ext data when fragmenting 2024-03-26 18:20:37 -04:00
skmsg.c bpf, sockmap: Fix NULL pointer dereference in sk_psock_verdict_data_ready() 2024-03-01 13:26:37 +01:00
sock.c udp: fix busy polling 2024-01-31 16:17:04 -08:00
sock_destructor.h
sock_diag.c sock_diag: annotate data-races around sock_diag_handlers[family] 2024-03-26 18:20:31 -04:00
sock_map.c bpf, sockmap: Prevent lock inversion deadlock in map delete elem 2024-04-10 16:28:25 +02:00
sock_reuseport.c
stream.c net: Return error from sk_stream_wait_connect() if sk_wait_event() fails 2024-01-01 12:38:56 +00:00
sysctl_net_core.c
timestamping.c
tso.c
utils.c
xdp.c