On 03/20/2018 07:19 PM, Yonghong Song wrote: > Commit 4bebdc7a85aa ("bpf: add helper bpf_perf_prog_read_value") > added helper bpf_perf_prog_read_value so that perf_event type program > can read event counter and enabled/running time. > This commit, however, introduced a bug which allows this helper > for tracepoint type programs. This is incorrect as bpf_perf_prog_read_value > needs to access perf_event through its bpf_perf_event_data_kern type context, > which is not available for tracepoint type program. > > This patch fixed the issue by separating bpf_func_proto between tracepoint > and perf_event type programs and removed bpf_perf_prog_read_value > from tracepoint func prototype. > > Fixes: Commit 4bebdc7a85aa ("bpf: add helper bpf_perf_prog_read_value") > Reported-by: Alexei Starovoitov <a...@kernel.org> > Signed-off-by: Yonghong Song <y...@fb.com>
Sigh, also makes sense to split given this is so subtle. Applied to bpf, thanks Yonghong!