Thread (2 messages) 2 messages, 2 authors, 2018-03-20

Re: [PATCH net] trace/bpf: remove helper bpf_perf_prog_read_value from tracepoint type programs

flat view

From: Daniel Borkmann <daniel@iogearbox.net>
Date: 2018-03-20 22:21:02

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 <ast@kernel.org>
Signed-off-by: Yonghong Song <redacted>
Sigh, also makes sense to split given this is so subtle. Applied to bpf,
thanks Yonghong!
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help