On Thu, Jun 25, 2020 at 4:48 PM 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_whitelist_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_whitelist_d_path) > > It defines following 'struct btf_id_set' variable to access > values and count: > > struct btf_id_set btf_whitelist_d_path; > > Adding 'allowed' callback to struct bpf_func_proto, to allow > verifier the check on allowed callers. > > Adding btf_id_set_contains, which will be used by allowed > callbacks to verify the caller's BTF ID value is within > allowed set. > > Signed-off-by: Jiri Olsa <jolsa@xxxxxxxxxx> > --- This looks nice! Acked-by: Andrii Nakryiko <andriin@xxxxxx> > include/linux/bpf.h | 4 ++++ > include/linux/btf_ids.h | 39 +++++++++++++++++++++++++++++++++++++++ > kernel/bpf/btf.c | 14 ++++++++++++++ > kernel/bpf/verifier.c | 5 +++++ > 4 files changed, 62 insertions(+) > [...]