Skip to content

Commit 0850e1b

Browse files
compudjrostedt
authored andcommitted
tracing/bpf: Add might_fault check to syscall probes
Add a might_fault() check to validate that the bpf sys_enter/sys_exit probe callbacks are indeed called from a context where page faults can be handled. Cc: Michael Jeanson <[email protected]> Cc: Masami Hiramatsu <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Alexei Starovoitov <[email protected]> Cc: Yonghong Song <[email protected]> Cc: Paul E. McKenney <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Andrii Nakryiko <[email protected]> Cc: [email protected] Cc: Joel Fernandes <[email protected]> Link: https://lore.kernel.org/[email protected] Acked-by: Andrii Nakryiko <[email protected]> Tested-by: Andrii Nakryiko <[email protected]> # BPF parts Signed-off-by: Mathieu Desnoyers <[email protected]> Signed-off-by: Steven Rostedt (Google) <[email protected]>
1 parent cdb537a commit 0850e1b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

include/trace/bpf_probe.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ __bpf_trace_##call(void *__data, proto) \
5757
static notrace void \
5858
__bpf_trace_##call(void *__data, proto) \
5959
{ \
60+
might_fault(); \
6061
preempt_disable_notrace(); \
6162
CONCATENATE(bpf_trace_run, COUNT_ARGS(args))(__data, CAST_TO_U64(args)); \
6263
preempt_enable_notrace(); \

0 commit comments

Comments
 (0)