summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorStanislav Fomichev <sdf@google.com>2022-07-20 18:52:20 +0300
committerDaniel Borkmann <daniel@iogearbox.net>2022-07-20 21:37:00 +0300
commit9cb61fda8c71baaff423fe5be2e609100860fa78 (patch)
tree23f73feb5fa4973b7331a8d7de184fc6e1c651a3 /include
parentb77ffb30cfc5f58e957571d8541c6a7e3da19221 (diff)
downloadlinux-9cb61fda8c71baaff423fe5be2e609100860fa78.tar.xz
bpf: Fix bpf_trampoline_{,un}link_cgroup_shim ifdef guards
They were updated in kernel/bpf/trampoline.c to fix another build issue. We should to do the same for include/linux/bpf.h header. Fixes: 3908fcddc65d ("bpf: fix lsm_cgroup build errors on esoteric configs") Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Stanislav Fomichev <sdf@google.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Martin KaFai Lau <kafai@fb.com> Link: https://lore.kernel.org/bpf/20220720155220.4087433-1-sdf@google.com
Diffstat (limited to 'include')
-rw-r--r--include/linux/bpf.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/include/linux/bpf.h b/include/linux/bpf.h
index a5bf00649995..11950029284f 100644
--- a/include/linux/bpf.h
+++ b/include/linux/bpf.h
@@ -1254,9 +1254,6 @@ struct bpf_dummy_ops {
int bpf_struct_ops_test_run(struct bpf_prog *prog, const union bpf_attr *kattr,
union bpf_attr __user *uattr);
#endif
-int bpf_trampoline_link_cgroup_shim(struct bpf_prog *prog,
- int cgroup_atype);
-void bpf_trampoline_unlink_cgroup_shim(struct bpf_prog *prog);
#else
static inline const struct bpf_struct_ops *bpf_struct_ops_find(u32 type_id)
{
@@ -1280,6 +1277,13 @@ static inline int bpf_struct_ops_map_sys_lookup_elem(struct bpf_map *map,
{
return -EINVAL;
}
+#endif
+
+#if defined(CONFIG_CGROUP_BPF) && defined(CONFIG_BPF_LSM)
+int bpf_trampoline_link_cgroup_shim(struct bpf_prog *prog,
+ int cgroup_atype);
+void bpf_trampoline_unlink_cgroup_shim(struct bpf_prog *prog);
+#else
static inline int bpf_trampoline_link_cgroup_shim(struct bpf_prog *prog,
int cgroup_atype)
{