Re: [PATCH v2 bpf 2/2] bpf: net: Avoid incorrect bpf_sk_reuseport_detach call

2020-07-09 Thread Martin KaFai Lau
On Thu, Jul 09, 2020 at 11:58:33AM +0100, James Chapman wrote: > On Wed, Jul 08, 2020 at 23:11:10 -0700, Martin KaFai Lau wrote: > > bpf_sk_reuseport_detach is currently called when sk->sk_user_data > > is not NULL. It is incorrect because sk->sk_user_data may not be > > managed by the bpf's reus

Re: [PATCH v2 bpf 2/2] bpf: net: Avoid incorrect bpf_sk_reuseport_detach call

2020-07-09 Thread James Chapman
On Wed, Jul 08, 2020 at 23:11:10 -0700, Martin KaFai Lau wrote: > bpf_sk_reuseport_detach is currently called when sk->sk_user_data > is not NULL. It is incorrect because sk->sk_user_data may not be > managed by the bpf's reuseport_array. It has been reported in [1] that, > the bpf_sk_reuseport_

[PATCH v2 bpf 2/2] bpf: net: Avoid incorrect bpf_sk_reuseport_detach call

2020-07-08 Thread Martin KaFai Lau
bpf_sk_reuseport_detach is currently called when sk->sk_user_data is not NULL. It is incorrect because sk->sk_user_data may not be managed by the bpf's reuseport_array. It has been reported in [1] that, the bpf_sk_reuseport_detach() which is called from udp_lib_unhash() has corrupted the sk_user_