From: John Fastabend <john.fastabend@gmail.com>
To: Jakub Kicinski <kuba@kernel.org>, davem@davemloft.net
Cc: netdev@vger.kernel.org, edumazet@google.com, pabeni@redhat.com,
Jakub Kicinski <kuba@kernel.org>,
john.fastabend@gmail.com, jakub@cloudflare.com,
yoshfuji@linux-ipv6.org, dsahern@kernel.org, ast@kernel.org,
daniel@iogearbox.net, andrii@kernel.org, kafai@fb.com,
songliubraving@fb.com, yhs@fb.com, kpsingh@kernel.org,
borisp@nvidia.com, cong.wang@bytedance.com, bpf@vger.kernel.org
Subject: RE: [PATCH net 2/2] sock: redo the psock vs ULP protection check
Date: Wed, 22 Jun 2022 07:00:10 -0700 [thread overview]
Message-ID: <62b3206a15bc4_3937b2085a@john.notmuch> (raw)
In-Reply-To: <20220620191353.1184629-2-kuba@kernel.org>
Jakub Kicinski wrote:
> Commit 8a59f9d1e3d4 ("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: 8a59f9d1e3d4 ("sock: Introduce sk->sk_prot->psock_update_sk_prot()")
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> ---
> CC: john.fastabend@gmail.com
> CC: jakub@cloudflare.com
> CC: yoshfuji@linux-ipv6.org
> CC: dsahern@kernel.org
> CC: ast@kernel.org
> CC: daniel@iogearbox.net
> CC: andrii@kernel.org
> CC: kafai@fb.com
> CC: songliubraving@fb.com
> CC: yhs@fb.com
> CC: kpsingh@kernel.org
> CC: borisp@nvidia.com
> CC: cong.wang@bytedance.com
> CC: bpf@vger.kernel.org
> ---
> include/net/inet_sock.h | 5 +++++
> net/core/skmsg.c | 5 +++++
> net/ipv4/tcp_bpf.c | 3 ---
> net/tls/tls_main.c | 2 ++
> 4 files changed, 12 insertions(+), 3 deletions(-)
Thanks Jakub this looks correct to me. I can't remember at the moment
or dig up in the email or git why it was originally moved into the
update logic. Maybe Cong can comment seeing it was his original patch?
I seemed to have missed the error path on original review :(
From my side though,
Reviewed-by: John Fastabend <john.fastabend@gmail.com>
next prev parent reply other threads:[~2022-06-22 14:00 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-20 19:13 [PATCH net 1/2] Revert "net/tls: fix tls_sk_proto_close executed repeatedly" Jakub Kicinski
2022-06-20 19:13 ` [PATCH net 2/2] sock: redo the psock vs ULP protection check Jakub Kicinski
2022-06-22 14:00 ` John Fastabend [this message]
2022-06-22 17:24 ` [PATCH net] selftests/bpf: Test sockmap update when socket has ULP Jakub Sitnicki
2022-06-23 5:42 ` John Fastabend
2022-06-23 9:12 ` Jakub Sitnicki
2022-06-22 17:24 ` [PATCH net 2/2] sock: redo the psock vs ULP protection check Jakub Sitnicki
2022-06-22 22:26 ` Jakub Kicinski
2022-06-23 9:12 ` [PATCH net v2] selftests/bpf: Test sockmap update when socket has ULP Jakub Sitnicki
2022-06-24 18:30 ` patchwork-bot+netdevbpf
2022-06-22 14:00 ` [PATCH net 1/2] Revert "net/tls: fix tls_sk_proto_close executed repeatedly" John Fastabend
2022-06-23 8:40 ` patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=62b3206a15bc4_3937b2085a@john.notmuch \
--to=john.fastabend@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=borisp@nvidia.com \
--cc=bpf@vger.kernel.org \
--cc=cong.wang@bytedance.com \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=jakub@cloudflare.com \
--cc=kafai@fb.com \
--cc=kpsingh@kernel.org \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=songliubraving@fb.com \
--cc=yhs@fb.com \
--cc=yoshfuji@linux-ipv6.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).