Subject: Re: [Patch bpf-next] skmsg: pass psock pointer to ->psock_update_sk_prot()

From: Jakub Sitnicki <[email-masked]>
Date: Mon, 12 Apr 2021 10:05:23 +0200

On Wed, Apr 07, 2021 at 05:21 AM CEST, Cong Wang wrote:
> From: Cong Wang <[email-masked]>
>
> Using sk_psock() to retrieve psock pointer from sock requires
> RCU read lock, but we already get psock pointer before calling
> ->psock_update_sk_prot() in both cases, so we can just pass it
> without bothering sk_psock().
>
> Reported-and-tested-by: [email-masked]
> Fixes: 8a59f9d1e3d4 ("sock: Introduce sk->sk_prot->psock_update_sk_prot()")
> Cc: John Fastabend <[email-masked]>
> Cc: Eric Dumazet <[email-masked]>
> Cc: Daniel Borkmann <[email-masked]>
> Cc: Jakub Sitnicki <[email-masked]>
> Cc: Lorenz Bauer <[email-masked]>
> Signed-off-by: Cong Wang <[email-masked]>
> ---

We don't necessarily need to pass both sk and psock.  psock has a
backpointer to sk that owns it.

Reviewed-by: Jakub Sitnicki <[email-masked]>