linux/net/core
Jakub Kicinski e34a07c0ae sock: redo the psock vs ULP protection check
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>
2022-06-23 10:08:30 +02:00
..
bpf_sk_storage.c
datagram.c
dev.c net: fix data-race in dev_isalive() 2022-06-17 10:59:31 +01:00
dev.h
dev_addr_lists.c
dev_addr_lists_test.c
dev_ioctl.c
devlink.c
drop_monitor.c
dst.c
dst_cache.c
failover.c
fib_notifier.c
fib_rules.c
filter.c
flow_dissector.c
flow_offload.c
gen_estimator.c
gen_stats.c
gro.c
gro_cells.c
hwbm.c
link_watch.c
lwt_bpf.c
lwtunnel.c
Makefile
neighbour.c
net-procfs.c
net-sysfs.c net: fix data-race in dev_isalive() 2022-06-17 10:59:31 +01:00
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
pktgen.c
ptp_classifier.c
request_sock.c
rtnetlink.c
scm.c
secure_seq.c
selftests.c
skbuff.c
skmsg.c sock: redo the psock vs ULP protection check 2022-06-23 10:08:30 +02:00
sock.c
sock_destructor.h
sock_diag.c
sock_map.c
sock_reuseport.c
stream.c
sysctl_net_core.c
timestamping.c
tso.c
utils.c
xdp.c