linux/kernel/bpf
Hou Tao 8421d4c876 bpf: Check validity of link->type in bpf_link_show_fdinfo()
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
2024-10-24 10:17:12 -07:00
..
preload
arena.c
arraymap.c bpf: Check percpu map value size first 2024-09-11 13:22:37 -07:00
bloom_filter.c
bpf_cgrp_storage.c
bpf_inode_storage.c
bpf_iter.c [tree-wide] finally take no_llseek out 2024-09-27 08:18:43 -07:00
bpf_local_storage.c
bpf_lru_list.c
bpf_lru_list.h
bpf_lsm.c bpf, lsm: Remove bpf_lsm_key_free hook 2024-10-08 12:52:40 -07:00
bpf_struct_ops.c
bpf_task_storage.c
btf.c bpf: Check the remaining info_cnt before repeating btf fields 2024-10-09 16:32:46 -07:00
btf_iter.c bpf: Remove custom build rule 2024-08-30 08:55:26 -07:00
btf_relocate.c bpf: Remove custom build rule 2024-08-30 08:55:26 -07:00
cgroup.c
cgroup_iter.c
core.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
cpumap.c bpf, cpumap: Move xdp:xdp_cpumap_kthread tracepoint before rcv 2024-09-11 16:32:11 +02:00
cpumask.c
crypto.c
devmap.c bpf: devmap: provide rxq after redirect 2024-10-02 13:48:26 -07:00
disasm.c
disasm.h
dispatcher.c
hashtab.c bpf: Check percpu map value size first 2024-09-11 13:22:37 -07:00
helpers.c bpf: Add MEM_WRITE attribute 2024-10-22 15:42:56 -07:00
inode.c bpf: Preserve param->string when parsing mount options 2024-10-22 12:56:38 -07:00
Kconfig
link_iter.c
local_storage.c
log.c bpf: Fix print_reg_state's constant scalar dump 2024-10-17 11:06:34 -07:00
lpm_trie.c
Makefile bpf: Remove custom build rule 2024-08-30 08:55:26 -07:00
map_in_map.c
map_in_map.h
map_iter.c
memalloc.c
mmap_unlock_work.h
mprog.c
net_namespace.c
offload.c
percpu_freelist.c
percpu_freelist.h
prog_iter.c
queue_stack_maps.c
relo_core.c bpf: Remove custom build rule 2024-08-30 08:55:26 -07:00
reuseport_array.c bpf: Use sockfd_put() helper 2024-08-30 08:57:47 -07:00
ringbuf.c bpf: Add MEM_WRITE attribute 2024-10-22 15:42:56 -07:00
stackmap.c bpf: wire up sleepable bpf_get_stack() and bpf_get_task_stack() helpers 2024-09-11 09:58:31 -07:00
syscall.c bpf: Check validity of link->type in bpf_link_show_fdinfo() 2024-10-24 10:17:12 -07:00
sysfs_btf.c
task_iter.c bpf: Fix iter/task tid filtering 2024-10-17 10:52:18 -07:00
tcx.c
tnum.c
token.c bpf: convert bpf_token_create() to CLASS(fd, ...) 2024-09-12 18:58:02 -07:00
trampoline.c
verifier.c bpf: fix do_misc_fixups() for bpf_get_branch_snapshot() 2024-10-23 22:16:45 -07:00