Skip to content

Commit cd52eda

Browse files
mhiramatIngo Molnar
authored andcommitted
kprobes/x86: Move the get_kprobe_ctlblk() into irq-disabled block
Since get_kprobe_ctlblk() accesses per-cpu variables which calls smp_processor_id(), it must be called under preempt-disabled or irq-disabled. Signed-off-by: Masami Hiramatsu <[email protected]> Cc: Alexei Starovoitov <[email protected]> Cc: Alexei Starovoitov <[email protected]> Cc: Ananth N Mavinakayanahalli <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Paul E . McKenney <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Steven Rostedt <[email protected]> Cc: Thomas Gleixner <[email protected]> Link: http://lkml.kernel.org/r/150581517952.32348.2655896843219158446.stgit@devbox Signed-off-by: Ingo Molnar <[email protected]>
1 parent 3539d09 commit cd52eda

File tree

1 file changed

+1
-1
lines changed
  • arch/x86/kernel/kprobes

1 file changed

+1
-1
lines changed

arch/x86/kernel/kprobes/opt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ STACK_FRAME_NON_STANDARD(optprobe_template_func);
154154
static void
155155
optimized_callback(struct optimized_kprobe *op, struct pt_regs *regs)
156156
{
157-
struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
158157
unsigned long flags;
159158

160159
/* This is possible if op is under delayed unoptimizing */
@@ -165,6 +164,7 @@ optimized_callback(struct optimized_kprobe *op, struct pt_regs *regs)
165164
if (kprobe_running()) {
166165
kprobes_inc_nmissed_count(&op->kp);
167166
} else {
167+
struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
168168
/* Save skipped registers */
169169
#ifdef CONFIG_X86_64
170170
regs->cs = __KERNEL_CS;

0 commit comments

Comments
 (0)