summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorAlexei Starovoitov <ast@kernel.org>2020-02-24 22:27:15 +0300
committerAlexei Starovoitov <ast@kernel.org>2020-02-25 03:17:14 +0300
commit70ed0706a48e3da3eb4515214fef658ff1184b9f (patch)
tree5386280db17266282a2020c44e3a15c47c484e6b /kernel
parent1b7a51a63b031092b8b8acda3f6820b62a8b5e5d (diff)
downloadlinux-70ed0706a48e3da3eb4515214fef658ff1184b9f.tar.xz
bpf: disable preemption for bpf progs attached to uprobe
trace_call_bpf() no longer disables preemption on its own. All callers of this function has to do it explicitly. Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/trace/trace_uprobe.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/kernel/trace/trace_uprobe.c b/kernel/trace/trace_uprobe.c
index 18d16f3ef980..2a8e8e9c1c75 100644
--- a/kernel/trace/trace_uprobe.c
+++ b/kernel/trace/trace_uprobe.c
@@ -1333,8 +1333,15 @@ static void __uprobe_perf_func(struct trace_uprobe *tu,
int size, esize;
int rctx;
- if (bpf_prog_array_valid(call) && !trace_call_bpf(call, regs))
- return;
+ if (bpf_prog_array_valid(call)) {
+ u32 ret;
+
+ preempt_disable();
+ ret = trace_call_bpf(call, regs);
+ preempt_enable();
+ if (!ret)
+ return;
+ }
esize = SIZEOF_TRACE_ENTRY(is_ret_probe(tu));