diff options
author | Daniel Borkmann <daniel@iogearbox.net> | 2016-06-27 21:38:11 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-07-11 09:30:01 -0700 |
commit | 5f97d2700356770686f89b2907de7f3b916e5ff9 (patch) | |
tree | 55e23f5c76fd24dddc048562b4f67e94a3f7c475 /include | |
parent | c369d2d6e7cda5e53d1b06ebfc2bc3921f0472a4 (diff) | |
download | lwn-5f97d2700356770686f89b2907de7f3b916e5ff9.tar.gz lwn-5f97d2700356770686f89b2907de7f3b916e5ff9.zip |
bpf, perf: delay release of BPF prog after grace period
[ Upstream commit ceb56070359b7329b5678b5d95a376fcb24767be ]
Commit dead9f29ddcc ("perf: Fix race in BPF program unregister") moved
destruction of BPF program from free_event_rcu() callback to __free_event(),
which is problematic if used with tail calls: if prog A is attached as
trace event directly, but at the same time present in a tail call map used
by another trace event program elsewhere, then we need to delay destruction
via RCU grace period since it can still be in use by the program doing the
tail call (the prog first needs to be dropped from the tail call map, then
trace event with prog A attached destroyed, so we get immediate destruction).
Fixes: dead9f29ddcc ("perf: Fix race in BPF program unregister")
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Cc: Jann Horn <jann@thejh.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/bpf.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/bpf.h b/include/linux/bpf.h index f1d5c5acc8dd..ca80d5830bfd 100644 --- a/include/linux/bpf.h +++ b/include/linux/bpf.h @@ -229,6 +229,10 @@ static inline struct bpf_prog *bpf_prog_get(u32 ufd) static inline void bpf_prog_put(struct bpf_prog *prog) { } + +static inline void bpf_prog_put_rcu(struct bpf_prog *prog) +{ +} #endif /* CONFIG_BPF_SYSCALL */ /* verifier prototypes for helper functions called from eBPF programs */ |