Skip to content

Commit 02106f8

Browse files
arighiIngo Molnar
authored andcommitted
kprobes: Prohibit probing on bsearch()
Since kprobe breakpoing handler is using bsearch(), probing on this routine can cause recursive breakpoint problem. int3 ->do_int3() ->ftrace_int3_handler() ->ftrace_location() ->ftrace_location_range() ->bsearch() -> int3 Prohibit probing on bsearch(). Signed-off-by: Andrea Righi <righi.andrea@gmail.com> Acked-by: Masami Hiramatsu <mhiramat@kernel.org> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Thomas Gleixner <tglx@linutronix.de> Link: http://lkml.kernel.org/r/154998813406.31052.8791425358974650922.stgit@devbox Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent 2f43c60 commit 02106f8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/bsearch.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
#include <linux/export.h>
1313
#include <linux/bsearch.h>
14+
#include <linux/kprobes.h>
1415

1516
/*
1617
* bsearch - binary search an array of elements
@@ -53,3 +54,4 @@ void *bsearch(const void *key, const void *base, size_t num, size_t size,
5354
return NULL;
5455
}
5556
EXPORT_SYMBOL(bsearch);
57+
NOKPROBE_SYMBOL(bsearch);

0 commit comments

Comments
 (0)