On Sun, Aug 9, 2020 at 8:05 AM Jiri Olsa <jo...@kernel.org> wrote: > > Adding btf_struct_ids_match function to check if given address provided > by BTF object + offset is also address of another nested BTF object. > > This allows to pass an argument to helper, which is defined via parent > BTF object + offset, like for bpf_d_path (added in following changes): > > SEC("fentry/filp_close") > int BPF_PROG(prog_close, struct file *file, void *id) > { > ... > ret = bpf_d_path(&file->f_path, ... > > The first bpf_d_path argument is hold by verifier as BTF file object > plus offset of f_path member. > > The btf_struct_ids_match function will walk the struct file object and > check if there's nested struct path object on the given offset. > > Signed-off-by: Jiri Olsa <jo...@kernel.org> > ---
LGTM. Acked-by: Andrii Nakryiko <andr...@fb.com> > include/linux/bpf.h | 2 ++ > kernel/bpf/btf.c | 31 +++++++++++++++++++++++++++++++ > kernel/bpf/verifier.c | 17 +++++++++++------ > 3 files changed, 44 insertions(+), 6 deletions(-) > [...]