TencentOS-kernel/kernel/bpf
Yonghong Song a911d32515 bpf: Enable bpf_iter targets registering ctx argument types
[upstream commit 3c32cc1bceba8a1755dc35cd97516f6c67856844]

Commit b121b341e598 ("bpf: Add PTR_TO_BTF_ID_OR_NULL
support") adds a field btf_id_or_null_non0_off to
bpf_prog->aux structure to indicate that the
first ctx argument is PTR_TO_BTF_ID reg_type and
all others are PTR_TO_BTF_ID_OR_NULL.
This approach does not really scale if we have
other different reg types in the future, e.g.,
a pointer to a buffer.

This patch enables bpf_iter targets registering ctx argument
reg types which may be different from the default one.
For example, for pointers to structures, the default reg_type
is PTR_TO_BTF_ID for tracing program. The target can register
a particular pointer type as PTR_TO_BTF_ID_OR_NULL which can
be used by the verifier to enforce accesses.

Signed-off-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Link: https://lore.kernel.org/bpf/20200513180221.2949882-1-yhs@fb.com
2022-06-21 10:27:12 +08:00
..
Makefile bpf: Add task and task/file iterator targets 2022-06-21 10:27:11 +08:00
arraymap.c bpf: Simplify __bpf_arch_text_poke poke type handling 2022-06-21 10:27:06 +08:00
bpf_iter.c bpf: Enable bpf_iter targets registering ctx argument types 2022-06-21 10:27:12 +08:00
bpf_lru_list.c bpf_lru_list: Read double-checked variable once without lock 2021-04-12 12:52:15 +08:00
bpf_lru_list.h Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
bpf_lsm.c bpf: lsm: Implement attach, detach and execution 2022-06-21 10:27:08 +08:00
bpf_struct_ops.c bpf: Refactor trampoline update code 2022-06-21 10:27:07 +08:00
bpf_struct_ops_types.h bpf: tcp: Support tcp_congestion_ops in bpf 2022-06-21 10:27:05 +08:00
btf.c bpf: Enable bpf_iter targets registering ctx argument types 2022-06-21 10:27:12 +08:00
cgroup.c bpf, cgroup: Return ENOLINK for auto-detached links on update 2022-06-21 10:27:09 +08:00
core.c bpf, netns: Handle multiple link attachments 2022-06-21 10:27:10 +08:00
cpumap.c cpumap: Avoid warning when CONFIG_DEBUG_PER_CPU_MAPS is enabled 2021-03-16 16:27:10 +08:00
devmap.c devmap: Use bpf_map_area_alloc() for allocating hash buckets 2021-03-16 16:30:57 +08:00
disasm.c bpf: Introduce BPF nospec instruction for mitigating Spectre v4 2022-06-21 10:27:02 +08:00
disasm.h Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
dispatcher.c bpf: Introduce BPF dispatcher 2022-06-21 10:27:06 +08:00
hashtab.c bpf: Factor out hashtab bucket lock operations 2022-06-21 10:27:08 +08:00
helpers.c bpf: Fix helper bpf_map_peek_elem_proto pointing to wrong callback 2021-03-16 16:44:00 +08:00
inode.c bpf: Create file bpf iterator 2022-06-21 10:27:11 +08:00
local_storage.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
lpm_trie.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
map_in_map.c bpf: Move owner type, jited info into array auxiliary data 2022-06-21 10:27:05 +08:00
map_in_map.h Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
map_iter.c bpf: Enable bpf_iter targets registering ctx argument types 2022-06-21 10:27:12 +08:00
net_namespace.c inet: Run SK_LOOKUP BPF program on socket lookup 2022-06-21 10:27:10 +08:00
offload.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
percpu_freelist.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
percpu_freelist.h Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
queue_stack_maps.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
reuseport_array.c net: Generate reuseport group ID on group creation 2022-06-21 10:27:07 +08:00
stackmap.c bpf: Check for integer overflow when using roundup_pow_of_two() 2021-04-12 12:52:03 +08:00
syscall.c bpf: Sharing bpf runtime stats with BPF_ENABLE_STATS 2022-06-21 10:27:12 +08:00
sysfs_btf.c bpf: Fix sysfs export of empty BTF section 2021-03-16 16:37:55 +08:00
task_iter.c bpf: Enable bpf_iter targets registering ctx argument types 2022-06-21 10:27:12 +08:00
tnum.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
trampoline.c bpf: lsm: Implement attach, detach and execution 2022-06-21 10:27:08 +08:00
verifier.c bpf: Enable bpf_iter targets registering ctx argument types 2022-06-21 10:27:12 +08:00
xskmap.c bpf: Implement map_gen_lookup() callback for XSKMAP 2022-06-21 10:27:03 +08:00