]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: Allow bpf_current_task_under_cgroup in interrupt
authorTeng Qin <qinteng@fb.com>
Sun, 29 Apr 2018 06:39:29 +0000 (23:39 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Sun, 29 Apr 2018 16:18:04 +0000 (09:18 -0700)
commit860e124e0b5f6193a290b044b022dc260adbc9ad
treee897e3fe2ecaf348d4780de5dd0227f802dcd48f
parent49069ba925d141470bab0a3693f19a1f7ff4a95d
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>
kernel/trace/bpf_trace.c