]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: Fix potential call bpf_link_free() in atomic context
authorMuchun Song <songmuchun@bytedance.com>
Thu, 17 Sep 2020 07:44:53 +0000 (15:44 +0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Mon, 21 Sep 2020 19:20:17 +0000 (21:20 +0200)
commitc35280a0c5ca1040641d85eeb929969fc008a03e
treee275566fe13c8fdd63f4b6206173f2e9692a5844
parent9d55296e4b82ac91e8d68d4f2ab208b8b0a97894
bpf: Fix potential call bpf_link_free() in atomic context

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 on the
safe side, so we can avoid this in the future.

Signed-off-by: Muchun Song <songmuchun@bytedance.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Song Liu <songliubraving@fb.com>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Link: https://lore.kernel.org/bpf/20200917074453.20621-1-songmuchun@bytedance.com
kernel/bpf/syscall.c