summaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorDavid Vernet <void@manifault.com>2023-01-25 10:47:34 -0600
committerAlexei Starovoitov <ast@kernel.org>2023-01-25 10:25:57 -0800
commit51a52a29ebaa8395de090fa415c6e1b2899a50f1 (patch)
tree03797261214da5c39912a7a5eae62fefcad1ea62 /include/linux
parent913b2255c3d876254e968f1e8e2c817cca283a29 (diff)
downloadlinux-stable-51a52a29ebaa8395de090fa415c6e1b2899a50f1.tar.gz
linux-stable-51a52a29ebaa8395de090fa415c6e1b2899a50f1.tar.bz2
linux-stable-51a52a29ebaa8395de090fa415c6e1b2899a50f1.zip
bpf: Pass const struct bpf_prog * to .check_member
The .check_member field of struct bpf_struct_ops is currently passed the member's btf_type via const struct btf_type *t, and a const struct btf_member *member. This allows the struct_ops implementation to check whether e.g. an ops is supported, but it would be useful to also enforce that the struct_ops prog being loaded for that member has other qualities, like being sleepable (or not). This patch therefore updates the .check_member() callback to also take a const struct bpf_prog *prog argument. Signed-off-by: David Vernet <void@manifault.com> Link: https://lore.kernel.org/r/20230125164735.785732-4-void@manifault.com Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/bpf.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/bpf.h b/include/linux/bpf.h
index 1bec48d9e5d9..0d868ef1b973 100644
--- a/include/linux/bpf.h
+++ b/include/linux/bpf.h
@@ -1422,7 +1422,8 @@ struct bpf_struct_ops {
const struct bpf_verifier_ops *verifier_ops;
int (*init)(struct btf *btf);
int (*check_member)(const struct btf_type *t,
- const struct btf_member *member);
+ const struct btf_member *member,
+ const struct bpf_prog *prog);
int (*init_member)(const struct btf_type *t,
const struct btf_member *member,
void *kdata, const void *udata);