diff options
author | Hou Tao <houtao1@huawei.com> | 2024-10-24 09:35:58 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-11-17 15:09:54 +0100 |
commit | b3eb1b6a9f745d6941b345f0fae014dc8bb06d36 (patch) | |
tree | 0df30d8bf978fdaad1261527c91d5e14d0a8eeef /tools/perf/scripts/python/stackcollapse.py | |
parent | bd965aba2ef089e6b7eab9aa66fbb82ac8839b68 (diff) |
bpf: Check validity of link->type in bpf_link_show_fdinfo()
[ Upstream commit 8421d4c8762bd022cb491f2f0f7019ef51b4f0a7 ]
If a newly-added link type doesn't invoke BPF_LINK_TYPE(), accessing
bpf_link_type_strs[link->type] may result in an out-of-bounds access.
To spot such missed invocations early in the future, checking the
validity of link->type in bpf_link_show_fdinfo() and emitting a warning
when such invocations are missed.
Signed-off-by: Hou Tao <houtao1@huawei.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20241024013558.1135167-3-houtao@huaweicloud.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions