Re: [PATCH bpf-next] bpf, netns: Fix use-after-free in pernet pre_exit callback

2020-07-01 Thread Lorenz Bauer
On Tue, 30 Jun 2020 at 17:45, Jakub Sitnicki wrote: > > Iterating over BPF links attached to network namespace in pre_exit hook is > not safe, even if there is just one. Once link gets auto-detached, that is > its back-pointer to net object is set to NULL, the link can be released and > freed with

Re: [PATCH bpf-next] bpf, netns: Fix use-after-free in pernet pre_exit callback

2020-06-30 Thread Andrii Nakryiko
On Tue, Jun 30, 2020 at 11:33 AM Jakub Sitnicki wrote: > > Iterating over BPF links attached to network namespace in pre_exit hook is > not safe, even if there is just one. Once link gets auto-detached, that is > its back-pointer to net object is set to NULL, the link can be released and > freed w

Re: [PATCH bpf-next] bpf, netns: Fix use-after-free in pernet pre_exit callback

2020-06-30 Thread Yonghong Song
On 6/30/20 9:45 AM, Jakub Sitnicki wrote: Iterating over BPF links attached to network namespace in pre_exit hook is not safe, even if there is just one. Once link gets auto-detached, that is its back-pointer to net object is set to NULL, the link can be released and freed without waiting on n

[PATCH bpf-next] bpf, netns: Fix use-after-free in pernet pre_exit callback

2020-06-30 Thread Jakub Sitnicki
Iterating over BPF links attached to network namespace in pre_exit hook is not safe, even if there is just one. Once link gets auto-detached, that is its back-pointer to net object is set to NULL, the link can be released and freed without waiting on netns_bpf_mutex, effectively causing the list el