[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAEf4BzZA_qgWEGma+APQZWs5qU07LdJKzKAxxusQThCGGfh2Vw@mail.gmail.com>
Date: Mon, 10 Aug 2020 23:02:01 -0700
From: Andrii Nakryiko <andrii.nakryiko@...il.com>
To: Jiri Olsa <jolsa@...nel.org>
Cc: Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Andrii Nakryiko <andriin@...com>,
Networking <netdev@...r.kernel.org>, bpf <bpf@...r.kernel.org>,
Song Liu <songliubraving@...com>, Yonghong Song <yhs@...com>,
Martin KaFai Lau <kafai@...com>,
David Miller <davem@...hat.com>,
John Fastabend <john.fastabend@...il.com>,
Wenbo Zhang <ethercflow@...il.com>,
KP Singh <kpsingh@...omium.org>,
Brendan Gregg <bgregg@...flix.com>,
Florent Revest <revest@...omium.org>,
Al Viro <viro@...iv.linux.org.uk>
Subject: Re: [RFC PATCH v11 bpf-next 08/14] bpf: Add btf_struct_ids_match function
On Sun, Aug 9, 2020 at 8:05 AM Jiri Olsa <jolsa@...nel.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 <jolsa@...nel.org>
> ---
LGTM.
Acked-by: Andrii Nakryiko <andriin@...com>
> include/linux/bpf.h | 2 ++
> kernel/bpf/btf.c | 31 +++++++++++++++++++++++++++++++
> kernel/bpf/verifier.c | 17 +++++++++++------
> 3 files changed, 44 insertions(+), 6 deletions(-)
>
[...]
Powered by blists - more mailing lists