On Sat, Aug 1, 2020 at 10:04 AM Jiri Olsa <jolsa@xxxxxxxxxx> wrote: > > Adding support to define sorted set of BTF ID values. > > Following defines sorted set of BTF ID values: > > BTF_SET_START(btf_allowlist_d_path) > BTF_ID(func, vfs_truncate) > BTF_ID(func, vfs_fallocate) > BTF_ID(func, dentry_open) > BTF_ID(func, vfs_getattr) > BTF_ID(func, filp_close) > BTF_SET_END(btf_allowlist_d_path) > > It defines following 'struct btf_id_set' variable to access > values and count: > > struct btf_id_set btf_allowlist_d_path; > > Adding 'allowed' callback to struct bpf_func_proto, to allow > verifier the check on allowed callers. > > Adding btf_id_set_contains function, which will be used by > allowed callbacks to verify the caller's BTF ID value is > within allowed set. > > Also removing extra '\' in __BTF_ID_LIST macro. > > Added BTF_SET_START_GLOBAL macro for global sets. > > Signed-off-by: Jiri Olsa <jolsa@xxxxxxxxxx> > --- LGTM. Acked-by: Andrii Nakryiko <andriin@xxxxxx> > include/linux/bpf.h | 4 +++ > include/linux/btf_ids.h | 51 ++++++++++++++++++++++++++++++++++- > kernel/bpf/btf.c | 14 ++++++++++ > kernel/bpf/verifier.c | 5 ++++ > tools/include/linux/btf_ids.h | 51 ++++++++++++++++++++++++++++++++++- > 5 files changed, 123 insertions(+), 2 deletions(-) > [...]