]> Git Repo - linux.git/commitdiff
kprobes/x86: Use preempt_enable() in optimized_callback()
authorMasami Hiramatsu <[email protected]>
Sat, 20 Oct 2018 09:47:53 +0000 (18:47 +0900)
committerIngo Molnar <[email protected]>
Mon, 22 Oct 2018 01:31:01 +0000 (03:31 +0200)
The following commit:

  a19b2e3d7839 ("kprobes/x86: Remove IRQ disabling from ftrace-based/optimized kprobes”)

removed local_irq_save/restore() from optimized_callback(), the handler
might be interrupted by the rescheduling interrupt and might be
rescheduled - so we must not use the preempt_enable_no_resched() macro.

Use preempt_enable() instead, to not lose preemption events.

[ mingo: Improved the changelog. ]

Reported-by: Nadav Amit <[email protected]>
Signed-off-by: Masami Hiramatsu <[email protected]>
Acked-by: Peter Zijlstra (Intel) <[email protected]>
Cc: <[email protected]>
Cc: Alexei Starovoitov <[email protected]>
Cc: Andy Lutomirski <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Oleg Nesterov <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: [email protected]
Fixes: a19b2e3d7839 ("kprobes/x86: Remove IRQ disabling from ftrace-based/optimized kprobes”)
Link: http://lkml.kernel.org/r/154002887331.7627.10194920925792947001.stgit@devbox
Signed-off-by: Ingo Molnar <[email protected]>
arch/x86/kernel/kprobes/opt.c

index eaf02f2e73005731e28dc22bd5d91d10fd26d2aa..40b16b2706560e409dfe57a9817d2c1832a4a89e 100644 (file)
@@ -179,7 +179,7 @@ optimized_callback(struct optimized_kprobe *op, struct pt_regs *regs)
                opt_pre_handler(&op->kp, regs);
                __this_cpu_write(current_kprobe, NULL);
        }
-       preempt_enable_no_resched();
+       preempt_enable();
 }
 NOKPROBE_SYMBOL(optimized_callback);
 
This page took 0.059363 seconds and 4 git commands to generate.