aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python
diff options
context:
space:
mode:
authorYonghong Song <[email protected]>2021-02-11 16:59:26 -0800
committerAlexei Starovoitov <[email protected]>2021-02-12 13:33:50 -0800
commit17d8beda277a36203585943e70c7909b60775fd5 (patch)
tree34a79d7c80beb57fff98e0ea1077e2b06e0192e8 /tools/perf/scripts/python
parent90a82b1fa40d0cee33d1c9306dc54412442d1e57 (diff)
bpf: Fix an unitialized value in bpf_iter
Commit 15d83c4d7cef ("bpf: Allow loading of a bpf_iter program") cached btf_id in struct bpf_iter_target_info so later on if it can be checked cheaply compared to checking registered names. syzbot found a bug that uninitialized value may occur to bpf_iter_target_info->btf_id. This is because we allocated bpf_iter_target_info structure with kmalloc and never initialized field btf_id afterwards. This uninitialized btf_id is typically compared to a u32 bpf program func proto btf_id, and the chance of being equal is extremely slim. This patch fixed the issue by using kzalloc which will also prevent future likely instances due to adding new fields. Fixes: 15d83c4d7cef ("bpf: Allow loading of a bpf_iter program") Reported-by: [email protected] Signed-off-by: Yonghong Song <[email protected]> Signed-off-by: Alexei Starovoitov <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions