Skip to content

Commit ee3685a

Browse files
compudjrostedt
authored andcommitted
tracing: Add might_fault() check in __DECLARE_TRACE_SYSCALL
Catch incorrect use of syscall tracepoints even if no probes are registered by adding a might_fault() check in trace_##name() emitted by __DECLARE_TRACE_SYSCALL. Suggested-by: Thomas Gleixner <[email protected]> Tested-by: Jordan Rife <[email protected]> Cc: Thomas Gleixner <[email protected]> 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]> Cc: Jordan Rife <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/[email protected] Signed-off-by: Mathieu Desnoyers <[email protected]> Signed-off-by: Steven Rostedt (Google) <[email protected]>
1 parent 2e8a12b commit ee3685a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

include/linux/tracepoint.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@ static inline struct tracepoint *tracepoint_ptr_deref(tracepoint_ptr_t *p)
301301
__DECLARE_TRACE_COMMON(name, PARAMS(proto), PARAMS(args), cond, PARAMS(data_proto)) \
302302
static inline void trace_##name(proto) \
303303
{ \
304+
might_fault(); \
304305
if (static_branch_unlikely(&__tracepoint_##name.key)) \
305306
__DO_TRACE(name, \
306307
TP_ARGS(args), \

0 commit comments

Comments
 (0)