summaryrefslogtreecommitdiffstats
path: root/kernel/trace/bpf_trace.c
diff options
context:
space:
mode:
authorTeng Qin <qinteng@fb.com>2018-04-29 08:39:29 +0200
committerAlexei Starovoitov <ast@kernel.org>2018-04-29 18:18:04 +0200
commit7ef3771205302a71a8bb4a2286ef98e5cade5d1a (patch)
treee897e3fe2ecaf348d4780de5dd0227f802dcd48f /kernel/trace/bpf_trace.c
parentMerge branch 'fix-bpf-helpers-doc' (diff)
downloadlinux-7ef3771205302a71a8bb4a2286ef98e5cade5d1a.tar.xz
linux-7ef3771205302a71a8bb4a2286ef98e5cade5d1a.zip
bpf: Allow bpf_current_task_under_cgroup in interrupt
Currently, the bpf_current_task_under_cgroup helper has a check where if the BPF program is running in_interrupt(), it will return -EINVAL. This prevents the helper to be used in many useful scenarios, particularly BPF programs attached to Perf Events. This commit removes the check. Tested a few NMI (Perf Event) and some softirq context, the helper returns the correct result. Signed-off-by: Teng Qin <qinteng@fb.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'kernel/trace/bpf_trace.c')
-rw-r--r--kernel/trace/bpf_trace.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/kernel/trace/bpf_trace.c b/kernel/trace/bpf_trace.c
index 46d866e9937c..ce2cbbff27e4 100644
--- a/kernel/trace/bpf_trace.c
+++ b/kernel/trace/bpf_trace.c
@@ -475,8 +475,6 @@ BPF_CALL_2(bpf_current_task_under_cgroup, struct bpf_map *, map, u32, idx)
struct bpf_array *array = container_of(map, struct bpf_array, map);
struct cgroup *cgrp;
- if (unlikely(in_interrupt()))
- return -EINVAL;
if (unlikely(idx >= array->map.max_entries))
return -E2BIG;