aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrea Righi <righi.andrea@gmail.com>2019-02-12 11:15:34 -0500
committerIngo Molnar <mingo@kernel.org>2019-02-13 02:16:41 -0500
commit02106f883cd745523f7766d90a739f983f19e650 (patch)
treefb78edd3ae6c8a3ab49a81ed7f08923b02be8bf6
parent2f43c6022d84b2f562623a7023f49f1431e50747 (diff)
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>
-rw-r--r--lib/bsearch.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/bsearch.c b/lib/bsearch.c
index 18b445b010c3..82512fe7b33c 100644
--- a/lib/bsearch.c
+++ b/lib/bsearch.c
@@ -11,6 +11,7 @@
11 11
12#include <linux/export.h> 12#include <linux/export.h>
13#include <linux/bsearch.h> 13#include <linux/bsearch.h>
14#include <linux/kprobes.h>
14 15
15/* 16/*
16 * bsearch - binary search an array of elements 17 * 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,
53 return NULL; 54 return NULL;
54} 55}
55EXPORT_SYMBOL(bsearch); 56EXPORT_SYMBOL(bsearch);
57NOKPROBE_SYMBOL(bsearch);