[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <154002887331.7627.10194920925792947001.stgit@devbox>
Date: Sat, 20 Oct 2018 18:47:53 +0900
From: Masami Hiramatsu <mhiramat@...nel.org>
To: Ingo Molnar <mingo@...hat.com>
Cc: Andy Lutomirski <luto@...nel.org>,
Alexei Starovoitov <alexei.starovoitov@...il.com>,
Oleg Nesterov <oleg@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
"H . Peter Anvin" <hpa@...or.com>,
Thomas Gleixner <tglx@...utronix.de>, X86 ML <x86@...nel.org>,
Borislav Petkov <bp@...en8.de>, dwmw@...zon.co.uk,
Masami Hiramatsu <mhiramat@...nel.org>,
linux-kernel@...r.kernel.org
Subject: [PATCH -tip] kprobes/x86: Use preempt_enable() in optimized_callback()
Since commit a19b2e3d7839 ("kprobes/x86: Remove IRQ disabling from
ftrace-based/optimized kprobes”) removes local_irq_save/restore()
from optimized_callback(), the handler does not protected against
reschedule interrupt. If it is able to be preempted (rescheduled)
by such interrupt, we don't need to use _no_resched macro.
Let's use preempt_enable() instead.
Fixes: a19b2e3d7839 ("kprobes/x86: Remove IRQ disabling from ftrace-based/optimized kprobes”)
Link: https://lkml.kernel.org/r/37CB98C2-AF9B-475B-8B2D-7B414DC491F3@vmware.com
Reported-by: Nadav Amit <namit@...are.com>
Signed-off-by: Masami Hiramatsu <mhiramat@...nel.org>
---
arch/x86/kernel/kprobes/opt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kernel/kprobes/opt.c b/arch/x86/kernel/kprobes/opt.c
index eaf02f2e7300..40b16b270656 100644
--- a/arch/x86/kernel/kprobes/opt.c
+++ b/arch/x86/kernel/kprobes/opt.c
@@ -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);
Powered by blists - more mailing lists