diff options
author | Masami Hiramatsu <mhiramat@kernel.org> | 2019-02-23 19:50:49 +0300 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2019-04-19 15:26:07 +0300 |
commit | b191fa96ea6dc00d331dcc28c1f7db5e075693a0 (patch) | |
tree | 2d4eaf3bd9fde019704de4a90b6bca19195a3de5 /include/linux/lockdep.h | |
parent | fabe38ab6b2bd9418350284c63825f13b8a6abba (diff) | |
download | linux-b191fa96ea6dc00d331dcc28c1f7db5e075693a0.tar.xz |
x86/kprobes: Avoid kretprobe recursion bug
Avoid kretprobe recursion loop bg by setting a dummy
kprobes to current_kprobe per-CPU variable.
This bug has been introduced with the asm-coded trampoline
code, since previously it used another kprobe for hooking
the function return placeholder (which only has a nop) and
trampoline handler was called from that kprobe.
This revives the old lost kprobe again.
With this fix, we don't see deadlock anymore.
And you can see that all inner-called kretprobe are skipped.
event_1 235 0
event_2 19375 19612
The 1st column is recorded count and the 2nd is missed count.
Above shows (event_1 rec) + (event_2 rec) ~= (event_2 missed)
(some difference are here because the counter is racy)
Reported-by: Andrea Righi <righi.andrea@gmail.com>
Tested-by: Andrea Righi <righi.andrea@gmail.com>
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: stable@vger.kernel.org
Fixes: c9becf58d935 ("[PATCH] kretprobe: kretprobe-booster")
Link: http://lkml.kernel.org/r/155094064889.6137.972160690963039.stgit@devbox
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include/linux/lockdep.h')
0 files changed, 0 insertions, 0 deletions