bpf: Recognize btf_decl_tag("arg: Arena") as PTR_TO_ARENA.
authorAlexei Starovoitov <ast@kernel.org>
Fri, 8 Mar 2024 01:08:04 +0000 (17:08 -0800)
committerAndrii Nakryiko <andrii@kernel.org>
Mon, 11 Mar 2024 22:37:24 +0000 (15:37 -0700)
commit2edc3de6fb650924a87fffebebc3b7572cbf6e38
tree507c3f99582f9326e792ab0a5078e424f1902520
parent6082b6c328b5486da2b356eae94b8b83c98b5565
bpf: Recognize btf_decl_tag("arg: Arena") as PTR_TO_ARENA.

In global bpf functions recognize btf_decl_tag("arg:arena") as PTR_TO_ARENA.

Note, when the verifier sees:

__weak void foo(struct bar *p)

it recognizes 'p' as PTR_TO_MEM and 'struct bar' has to be a struct with scalars.
Hence the only way to use arena pointers in global functions is to tag them with "arg:arena".

Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Link: https://lore.kernel.org/bpf/20240308010812.89848-7-alexei.starovoitov@gmail.com
include/linux/bpf.h
kernel/bpf/btf.c
kernel/bpf/verifier.c