diff options
author | Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> | 2014-04-17 04:17:26 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2014-04-24 04:02:58 -0400 |
commit | 98def1dedd00f42ded8423c418c971751f46aad2 (patch) | |
tree | 33852494b1b3f98dcf26e30a9cc8a4cb8949ac44 /arch/x86/lib/thunk_64.S | |
parent | 8027197220e02d5cebbbfdff36c2827661fbc692 (diff) |
kprobes, x86: Prohibit probing on thunk functions and restore
thunk/restore functions are also used for tracing irqoff etc.
and those are involved in kprobe's exception handling.
Prohibit probing on them to avoid kernel crash.
Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Reviewed-by: Steven Rostedt <rostedt@goodmis.org>
Link: http://lkml.kernel.org/r/20140417081726.26341.3872.stgit@ltc230.yrl.intra.hitachi.co.jp
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/lib/thunk_64.S')
-rw-r--r-- | arch/x86/lib/thunk_64.S | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/x86/lib/thunk_64.S b/arch/x86/lib/thunk_64.S index a63efd6bb6a5..92d9feaff42b 100644 --- a/arch/x86/lib/thunk_64.S +++ b/arch/x86/lib/thunk_64.S | |||
@@ -8,6 +8,7 @@ | |||
8 | #include <linux/linkage.h> | 8 | #include <linux/linkage.h> |
9 | #include <asm/dwarf2.h> | 9 | #include <asm/dwarf2.h> |
10 | #include <asm/calling.h> | 10 | #include <asm/calling.h> |
11 | #include <asm/asm.h> | ||
11 | 12 | ||
12 | /* rdi: arg1 ... normal C conventions. rax is saved/restored. */ | 13 | /* rdi: arg1 ... normal C conventions. rax is saved/restored. */ |
13 | .macro THUNK name, func, put_ret_addr_in_rdi=0 | 14 | .macro THUNK name, func, put_ret_addr_in_rdi=0 |
@@ -25,6 +26,7 @@ | |||
25 | call \func | 26 | call \func |
26 | jmp restore | 27 | jmp restore |
27 | CFI_ENDPROC | 28 | CFI_ENDPROC |
29 | _ASM_NOKPROBE(\name) | ||
28 | .endm | 30 | .endm |
29 | 31 | ||
30 | #ifdef CONFIG_TRACE_IRQFLAGS | 32 | #ifdef CONFIG_TRACE_IRQFLAGS |
@@ -43,3 +45,4 @@ restore: | |||
43 | RESTORE_ARGS | 45 | RESTORE_ARGS |
44 | ret | 46 | ret |
45 | CFI_ENDPROC | 47 | CFI_ENDPROC |
48 | _ASM_NOKPROBE(restore) | ||