Re: [RFC PATCH] bpf: Fix potential call bpf_link_free() in atomic context

2020-09-21 Thread Daniel Borkmann
On 9/21/20 8:31 PM, Andrii Nakryiko wrote: On Mon, Sep 21, 2020 at 10:29 AM Andrii Nakryiko wrote: On Thu, Sep 17, 2020 at 12:46 AM Muchun Song wrote: The in_atomic macro cannot always detect atomic context. In particular, it cannot know about held spinlocks in non-preemptible kernels. Alth

Re: [RFC PATCH] bpf: Fix potential call bpf_link_free() in atomic context

2020-09-21 Thread Andrii Nakryiko
On Mon, Sep 21, 2020 at 10:29 AM Andrii Nakryiko wrote: > > On Thu, Sep 17, 2020 at 12:46 AM Muchun Song wrote: > > > > The in_atomic macro cannot always detect atomic context. In particular, > > it cannot know about held spinlocks in non-preemptible kernels. Although, > > there is no user call b

Re: [RFC PATCH] bpf: Fix potential call bpf_link_free() in atomic context

2020-09-21 Thread Andrii Nakryiko
On Thu, Sep 17, 2020 at 12:46 AM Muchun Song wrote: > > The in_atomic macro cannot always detect atomic context. In particular, > it cannot know about held spinlocks in non-preemptible kernels. Although, > there is no user call bpf_link_put() with holding spinlock now. Be the > safe side, we can a

Re: [External] Re: [RFC PATCH] bpf: Fix potential call bpf_link_free() in atomic context

2020-09-18 Thread Muchun Song
On Fri, Sep 18, 2020 at 6:37 AM Song Liu wrote: > > On Thu, Sep 17, 2020 at 12:46 AM Muchun Song wrote: > > > > The in_atomic macro cannot always detect atomic context. In particular, > > it cannot know about held spinlocks in non-preemptible kernels. Although, > > there is no user call bpf_link_

Re: [RFC PATCH] bpf: Fix potential call bpf_link_free() in atomic context

2020-09-17 Thread Song Liu
On Thu, Sep 17, 2020 at 12:46 AM Muchun Song wrote: > > The in_atomic macro cannot always detect atomic context. In particular, > it cannot know about held spinlocks in non-preemptible kernels. Although, > there is no user call bpf_link_put() with holding spinlock now. Be the > safe side, we can a

[RFC PATCH] bpf: Fix potential call bpf_link_free() in atomic context

2020-09-17 Thread Muchun Song
The in_atomic macro cannot always detect atomic context. In particular, it cannot know about held spinlocks in non-preemptible kernels. Although, there is no user call bpf_link_put() with holding spinlock now. Be the safe side, we can avoid this in the feature. Signed-off-by: Muchun Song --- ker