Re: [Patch bpf-next v2 2/9] sock: introduce sk_prot->update_proto()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Cong Wang wrote:
> On Fri, Mar 5, 2021 at 5:55 PM John Fastabend <john.fastabend@xxxxxxxxx> wrote:
> >

[...]

> > > // tcp_bpf_prots->unhash == sock_map_unhash
> > > sk_psock_restore_proto();
> > > // Now  tcp_bpf_prots->unhash is inet_unhash
> > > ...
> > > sk_psock_update_proto();
> > > // sk->sk_proto is now tcp_bpf_prots again,
> > > // so its ->unhash now is inet_unhash
> > > // but it should be sock_map_unhash here
> >
> > Right, we can fix this on the TLS side. I'll push a fix shortly.
> 
> Are you still working on this? If kTLS still needs it, then we can
> have something like this:

Testing a fix now I will flush it out tomorrow. The below is not
really correct either it just moves the issue so it only impacts
TLS.

> 
> diff --git a/include/linux/skmsg.h b/include/linux/skmsg.h
> index 8edbbf5f2f93..5eb617df7f48 100644
> --- a/include/linux/skmsg.h
> +++ b/include/linux/skmsg.h
> @@ -349,8 +349,8 @@ static inline void sk_psock_update_proto(struct sock *sk,
>  static inline void sk_psock_restore_proto(struct sock *sk,
>                                           struct sk_psock *psock)
>  {
> -       sk->sk_prot->unhash = psock->saved_unhash;
>         if (inet_csk_has_ulp(sk)) {
> +               sk->sk_prot->unhash = psock->saved_unhash;
>                 tcp_update_ulp(sk, psock->sk_proto, psock->saved_write_space);
>         } else {
>                 sk->sk_write_space = psock->saved_write_space;
> 
> 
> Thanks.



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux