OSDN Git Service

kprobes: Search non-suffixed symbol in blacklist
authorMasami Hiramatsu <mhiramat@kernel.org>
Tue, 12 Feb 2019 16:13:12 +0000 (01:13 +0900)
committerIngo Molnar <mingo@kernel.org>
Wed, 13 Feb 2019 07:16:40 +0000 (08:16 +0100)
commit6143c6fb1e8f9bde9c434038f7548a19d36b55e7
tree20b9b8aa8d376e83e4e168807a2fd5e82af59cca
parent0eae81dc9f026d899c70f3931bf3bca6d7aa6938
kprobes: Search non-suffixed symbol in blacklist

Newer GCC versions can generate some different instances of a function
with suffixed symbols if the function is optimized and only
has a part of that. (e.g. .constprop, .part etc.)

In this case, it is not enough to check the entry of kprobe
blacklist because it only records non-suffixed symbol address.

To fix this issue, search non-suffixed symbol in blacklist if
given address is within a symbol which has a suffix.

Note that this can cause false positive cases if a kprobe-safe
function is optimized to suffixed instance and has same name
symbol which is blacklisted.
But I would like to chose a fail-safe design for this issue.

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Reviewed-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andrea Righi <righi.andrea@gmail.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/154998799234.31052.6136378903570418008.stgit@devbox
Signed-off-by: Ingo Molnar <mingo@kernel.org>
kernel/kprobes.c