diff options
author | Masami Hiramatsu <[email protected]> | 2019-02-24 01:50:49 +0900 |
---|---|---|
committer | Ingo Molnar <[email protected]> | 2019-04-19 14:26:07 +0200 |
commit | b191fa96ea6dc00d331dcc28c1f7db5e075693a0 (patch) | |
tree | 2d4eaf3bd9fde019704de4a90b6bca19195a3de5 /tools/testing | |
parent | fabe38ab6b2bd9418350284c63825f13b8a6abba (diff) |
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 <[email protected]>
Tested-by: Andrea Righi <[email protected]>
Signed-off-by: Masami Hiramatsu <[email protected]>
Acked-by: Steven Rostedt <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Mathieu Desnoyers <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: [email protected]
Fixes: c9becf58d935 ("[PATCH] kretprobe: kretprobe-booster")
Link: http://lkml.kernel.org/r/155094064889.6137.972160690963039.stgit@devbox
Signed-off-by: Ingo Molnar <[email protected]>
Diffstat (limited to 'tools/testing')
0 files changed, 0 insertions, 0 deletions