Skip to content

Commit 13b8c2e

Browse files
mhiramatgregkh
authored andcommitted
kprobes/x86: Use preempt_enable() in optimized_callback()
commit 2e62024 upstream. The following commit: a19b2e3 ("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: a19b2e3 ("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]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 5ef3e6e commit 13b8c2e

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
@@ -179,7 +179,7 @@ optimized_callback(struct optimized_kprobe *op, struct pt_regs *regs)
179179
opt_pre_handler(&op->kp, regs);
180180
__this_cpu_write(current_kprobe, NULL);
181181
}
182-
preempt_enable_no_resched();
182+
preempt_enable();
183183
}
184184
NOKPROBE_SYMBOL(optimized_callback);
185185

0 commit comments

Comments
 (0)