aboutsummaryrefslogtreecommitdiffstats
path: root/tools/lib/subcmd/help.c
diff options
context:
space:
mode:
authorIan Rogers <[email protected]>2025-09-02 18:17:13 +0000
committerNamhyung Kim <[email protected]>2025-09-02 21:55:32 +0000
commit01be43f2a0eaeed83e94dee054742f37625c86d9 (patch)
tree91f1796daaa4780465347395909d358118efaf21 /tools/lib/subcmd/help.c
parentperf bpf-utils: Constify bpil_array_desc (diff)
downloadkernel-01be43f2a0eaeed83e94dee054742f37625c86d9.tar.gz
kernel-01be43f2a0eaeed83e94dee054742f37625c86d9.zip
perf bpf-utils: Harden get_bpf_prog_info_linear
In get_bpf_prog_info_linear two calls to bpf_obj_get_info_by_fd are made, the first to compute memory requirements for a struct perf_bpil and the second to fill it in. Previously the code would warn when the second call didn't match the first. Such races can be common place in things like perf test, whose perf trace tests will frequently load BPF programs. Rather than a debug message, return actual errors for this case. Out of paranoia also validate the read bpf_prog_info array value. Change the type of ptr to avoid mismatched pointer type compiler warnings. Add some additional debug print outs and sanity asserts. Closes: https://lore.kernel.org/lkml/CAP-5=fWJQcmUOP7MuCA2ihKnDAHUCOBLkQFEkQES-1ZZTrgf8Q@mail.gmail.com/ Fixes: 6ac22d036f86 ("perf bpf: Pull in bpf_program__get_prog_info_linear()") Reviewed-by: Namhyung Kim <[email protected]> Signed-off-by: Ian Rogers <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Namhyung Kim <[email protected]>
Diffstat (limited to 'tools/lib/subcmd/help.c')
0 files changed, 0 insertions, 0 deletions