On 3/31/21 4:32 AM, Cong Wang wrote: > From: Cong Wang <cong.wang@xxxxxxxxxxxxx> > > Currently sockmap calls into each protocol to update the struct > proto and replace it. This certainly won't work when the protocol > is implemented as a module, for example, AF_UNIX. > > Introduce a new ops sk->sk_prot->psock_update_sk_prot(), so each > protocol can implement its own way to replace the struct proto. > This also helps get rid of symbol dependencies on CONFIG_INET. [...] > > -struct proto *tcp_bpf_get_proto(struct sock *sk, struct sk_psock *psock) > +int tcp_bpf_update_proto(struct sock *sk, bool restore) > { > + struct sk_psock *psock = sk_psock(sk); I do not think RCU is held here ? sk_psock() is using rcu_dereference_sk_user_data() > int family = sk->sk_family == AF_INET6 ? TCP_BPF_IPV6 : TCP_BPF_IPV4; > int config = psock->progs.msg_parser ? TCP_BPF_TX : TCP_BPF_BASE; > Same issue in udp_bpf_update_proto() of course.