[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tip-2e62024c265aa69315ed02835623740030435380@git.kernel.org>
Date: Sun, 21 Oct 2018 18:33:51 -0700
From: tip-bot for Masami Hiramatsu <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: tglx@...utronix.de, oleg@...hat.com, torvalds@...ux-foundation.org,
namit@...are.com, mingo@...nel.org, alexei.starovoitov@...il.com,
hpa@...or.com, mhiramat@...nel.org, peterz@...radead.org,
linux-kernel@...r.kernel.org, luto@...nel.org,
stable@...r.kernel.org, bp@...en8.de
Subject: [tip:perf/core] kprobes/x86: Use preempt_enable() in
optimized_callback()
Commit-ID: 2e62024c265aa69315ed02835623740030435380
Gitweb: https://git.kernel.org/tip/2e62024c265aa69315ed02835623740030435380
Author: Masami Hiramatsu <mhiramat@...nel.org>
AuthorDate: Sat, 20 Oct 2018 18:47:53 +0900
Committer: Ingo Molnar <mingo@...nel.org>
CommitDate: Mon, 22 Oct 2018 03:31:01 +0200
kprobes/x86: Use preempt_enable() in optimized_callback()
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 <namit@...are.com>
Signed-off-by: Masami Hiramatsu <mhiramat@...nel.org>
Acked-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Cc: <stable@...r.kernel.org>
Cc: Alexei Starovoitov <alexei.starovoitov@...il.com>
Cc: Andy Lutomirski <luto@...nel.org>
Cc: Borislav Petkov <bp@...en8.de>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Oleg Nesterov <oleg@...hat.com>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: dwmw@...zon.co.uk
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 <mingo@...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