]> git.baikalelectronics.ru Git - kernel.git/commit
libbpf: Mark BPF subprogs with hidden visibility as static for BPF verifier
authorAndrii Nakryiko <andrii@kernel.org>
Fri, 23 Apr 2021 18:13:34 +0000 (11:13 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 23 Apr 2021 21:05:26 +0000 (14:05 -0700)
commite1fe5007111545322421bf6dc28a2576a5fa75f4
tree044aaf22b476bf1e16840f21a1a34eb996eed748
parent06b39a1438dbaa836893133d2e8b10c7240de55c
libbpf: Mark BPF subprogs with hidden visibility as static for BPF verifier

Define __hidden helper macro in bpf_helpers.h, which is a short-hand for
__attribute__((visibility("hidden"))). Add libbpf support to mark BPF
subprograms marked with __hidden as static in BTF information to enforce BPF
verifier's static function validation algorithm, which takes more information
(caller's context) into account during a subprogram validation.

Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/20210423181348.1801389-5-andrii@kernel.org
tools/lib/bpf/bpf_helpers.h
tools/lib/bpf/btf.c
tools/lib/bpf/libbpf.c
tools/lib/bpf/libbpf_internal.h