]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: Allow BTF ctx access for string pointers
authorJiri Olsa <jolsa@kernel.org>
Thu, 23 Jan 2020 16:15:06 +0000 (17:15 +0100)
committerAlexei Starovoitov <ast@kernel.org>
Sat, 25 Jan 2020 15:12:40 +0000 (07:12 -0800)
commitbe55cc9b16f96284a6f5e6737ff292eaf9c0e258
treeeb5de4f71b8c7f558e487755fe753f99cbe2f205
parentb9cdaeac2b628add88287d690783131ce5ee000c
bpf: Allow BTF ctx access for string pointers

When accessing the context we allow access to arguments with
scalar type and pointer to struct. But we deny access for
pointer to scalar type, which is the case for many functions.

Alexei suggested to take conservative approach and allow
currently only string pointer access, which is the case
for most functions now:

Adding check if the pointer is to string type and allow access to it.

Suggested-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20200123161508.915203-2-jolsa@kernel.org
kernel/bpf/btf.c