bpf: check that BPF programs run with preemption disabled
authorPeter Zijlstra <peterz@infradead.org>
Tue, 29 Jan 2019 01:21:52 +0000 (17:21 -0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Tue, 19 Feb 2019 20:53:07 +0000 (21:53 +0100)
commit568f196756ad9fe2b49c46bbf6a9de1b190438b4
treea8c84a1e56786296cd005d6c7ca7ad741c2367ea
parenta5d9265e017f081f0dc133c0e2f45103d027b874
bpf: check that BPF programs run with preemption disabled

Introduce cant_sleep() macro for annotation of functions that
cannot sleep.

Use it in BPF_PROG_RUN to catch execution of BPF programs in
preemptable context.

Suggested-by: Jann Horn <jannh@google.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
include/linux/filter.h
include/linux/kernel.h
kernel/sched/core.c