diff options
author | Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> | 2014-04-17 04:17:12 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2014-04-24 04:02:57 -0400 |
commit | 0f46efeb44e360b78f54a968b4d92e6877c35891 (patch) | |
tree | 967be90bf26a1ec084e476d59e324c456d79f5c1 /arch/x86 | |
parent | 376e242429bf8539ef39a080ac113c8799840b13 (diff) |
kprobes, x86: Prohibit probing on debug_stack_*()
Prohibit probing on debug_stack_reset and debug_stack_set_zero.
Since the both functions are called from TRACE_IRQS_ON/OFF_DEBUG
macros which run in int3 ist entry, probing it may cause a soft
lockup.
This happens when the kernel built with CONFIG_DYNAMIC_FTRACE=y
and CONFIG_TRACE_IRQFLAGS=y.
Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Reviewed-by: Steven Rostedt <rostedt@goodmis.org>
Cc: Borislav Petkov <bp@suse.de>
Cc: Jan Beulich <JBeulich@suse.com>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: Seiji Aguchi <seiji.aguchi@hds.com>
Link: http://lkml.kernel.org/r/20140417081712.26341.32994.stgit@ltc230.yrl.intra.hitachi.co.jp
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/kernel/cpu/common.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index a135239badb7..5af696dddd1d 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c | |||
@@ -8,6 +8,7 @@ | |||
8 | #include <linux/delay.h> | 8 | #include <linux/delay.h> |
9 | #include <linux/sched.h> | 9 | #include <linux/sched.h> |
10 | #include <linux/init.h> | 10 | #include <linux/init.h> |
11 | #include <linux/kprobes.h> | ||
11 | #include <linux/kgdb.h> | 12 | #include <linux/kgdb.h> |
12 | #include <linux/smp.h> | 13 | #include <linux/smp.h> |
13 | #include <linux/io.h> | 14 | #include <linux/io.h> |
@@ -1160,6 +1161,7 @@ int is_debug_stack(unsigned long addr) | |||
1160 | (addr <= __get_cpu_var(debug_stack_addr) && | 1161 | (addr <= __get_cpu_var(debug_stack_addr) && |
1161 | addr > (__get_cpu_var(debug_stack_addr) - DEBUG_STKSZ)); | 1162 | addr > (__get_cpu_var(debug_stack_addr) - DEBUG_STKSZ)); |
1162 | } | 1163 | } |
1164 | NOKPROBE_SYMBOL(is_debug_stack); | ||
1163 | 1165 | ||
1164 | DEFINE_PER_CPU(u32, debug_idt_ctr); | 1166 | DEFINE_PER_CPU(u32, debug_idt_ctr); |
1165 | 1167 | ||
@@ -1168,6 +1170,7 @@ void debug_stack_set_zero(void) | |||
1168 | this_cpu_inc(debug_idt_ctr); | 1170 | this_cpu_inc(debug_idt_ctr); |
1169 | load_current_idt(); | 1171 | load_current_idt(); |
1170 | } | 1172 | } |
1173 | NOKPROBE_SYMBOL(debug_stack_set_zero); | ||
1171 | 1174 | ||
1172 | void debug_stack_reset(void) | 1175 | void debug_stack_reset(void) |
1173 | { | 1176 | { |
@@ -1176,6 +1179,7 @@ void debug_stack_reset(void) | |||
1176 | if (this_cpu_dec_return(debug_idt_ctr) == 0) | 1179 | if (this_cpu_dec_return(debug_idt_ctr) == 0) |
1177 | load_current_idt(); | 1180 | load_current_idt(); |
1178 | } | 1181 | } |
1182 | NOKPROBE_SYMBOL(debug_stack_reset); | ||
1179 | 1183 | ||
1180 | #else /* CONFIG_X86_64 */ | 1184 | #else /* CONFIG_X86_64 */ |
1181 | 1185 | ||