mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-28 17:41:50 +00:00
skmsg: Pass psock pointer to ->psock_update_sk_prot()
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().
Fixes: 8a59f9d1e3
("sock: Introduce sk->sk_prot->psock_update_sk_prot()")
Reported-by: syzbot+320a3bc8d80f478c37e4@syzkaller.appspotmail.com
Signed-off-by: Cong Wang <cong.wang@bytedance.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Tested-by: syzbot+320a3bc8d80f478c37e4@syzkaller.appspotmail.com
Reviewed-by: Jakub Sitnicki <jakub@cloudflare.com>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Link: https://lore.kernel.org/bpf/20210407032111.33398-1-xiyou.wangcong@gmail.com
This commit is contained in:
parent
cbaa683bb3
commit
51e0158a54
7 changed files with 12 additions and 10 deletions
|
@ -188,7 +188,7 @@ static int sock_map_init_proto(struct sock *sk, struct sk_psock *psock)
|
|||
if (!sk->sk_prot->psock_update_sk_prot)
|
||||
return -EINVAL;
|
||||
psock->psock_update_sk_prot = sk->sk_prot->psock_update_sk_prot;
|
||||
return sk->sk_prot->psock_update_sk_prot(sk, false);
|
||||
return sk->sk_prot->psock_update_sk_prot(sk, psock, false);
|
||||
}
|
||||
|
||||
static struct sk_psock *sock_map_psock_get_checked(struct sock *sk)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue