WSL2-Linux-Kernel/net/core
Jakub Kicinski 72fa0f65b5 sock: redo the psock vs ULP protection check
[ Upstream commit e34a07c0ae ]

Commit 8a59f9d1e3 ("sock: Introduce sk->sk_prot->psock_update_sk_prot()")
has moved the inet_csk_has_ulp(sk) check from sk_psock_init() to
the new tcp_bpf_update_proto() function. I'm guessing that this
was done to allow creating psocks for non-inet sockets.

Unfortunately the destruction path for psock includes the ULP
unwind, so we need to fail the sk_psock_init() itself.
Otherwise if ULP is already present we'll notice that later,
and call tcp_update_ulp() with the sk_proto of the ULP
itself, which will most likely result in the ULP looping
its callbacks.

Fixes: 8a59f9d1e3 ("sock: Introduce sk->sk_prot->psock_update_sk_prot()")
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: John Fastabend <john.fastabend@gmail.com>
Reviewed-by: Jakub Sitnicki <jakub@cloudflare.com>
Tested-by: Jakub Sitnicki <jakub@cloudflare.com>
Link: https://lore.kernel.org/r/20220620191353.1184629-2-kuba@kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-06-29 09:03:25 +02:00
..
Makefile
bpf_sk_storage.c bpf: Introduce MEM_RDONLY flag 2022-05-01 17:22:24 +02:00
datagram.c
datagram.h
dev.c net: fix data-race in dev_isalive() 2022-06-29 09:03:22 +02:00
dev_addr_lists.c
dev_ioctl.c
devlink.c
drop_monitor.c
dst.c
dst_cache.c
failover.c
fib_notifier.c
fib_rules.c
filter.c bpf: Fix request_sock leak in sk lookup helpers 2022-06-29 09:03:22 +02:00
flow_dissector.c net/sched: flower: fix parsing of ethertype following VLAN header 2022-04-20 09:34:09 +02:00
flow_offload.c netfilter: nf_tables: bail out early if hardware offload is not supported 2022-06-14 18:36:17 +02:00
gen_estimator.c
gen_stats.c
gro_cells.c
hwbm.c
link_watch.c net: Write lock dev_base_lock without disabling bottom halves. 2022-06-29 09:03:22 +02:00
lwt_bpf.c bpf, lwt: Fix crash when using bpf_skb_set_tunnel_key() from bpf_xmit lwt hook 2022-05-09 09:14:35 +02:00
lwtunnel.c
neighbour.c
net-procfs.c
net-sysfs.c net: fix data-race in dev_isalive() 2022-06-29 09:03:22 +02:00
net-sysfs.h
net-traces.c
net_namespace.c net: initialize init_net earlier 2022-04-13 20:59:03 +02:00
netclassid_cgroup.c
netevent.c
netpoll.c
netprio_cgroup.c
of_net.c
page_pool.c
pktgen.c
ptp_classifier.c
request_sock.c
rtnetlink.c net: Write lock dev_base_lock without disabling bottom halves. 2022-06-29 09:03:22 +02:00
scm.c
secure_seq.c tcp: resalt the secret every 10 seconds 2022-05-18 10:26:53 +02:00
selftests.c
skbuff.c net: fix wrong network header length 2022-05-25 09:57:35 +02:00
skmsg.c sock: redo the psock vs ULP protection check 2022-06-29 09:03:25 +02:00
sock.c
sock_destructor.h
sock_diag.c
sock_map.c bpf: Introduce MEM_RDONLY flag 2022-05-01 17:22:24 +02:00
sock_reuseport.c
stream.c
sysctl_net_core.c
timestamping.c
tso.c
utils.c
xdp.c