Skip to contentSkip to conversation

bpf: fix bpf_trampoline_{,un}link_cgroup_shim ifdef guards

PATCH Applied Stanislav Fomichev 3 participants 3 messages Jul 20, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 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.

v2:
- Martin: bpf_trampoline_link_cgroup_shim should be fixed as well

Fixes 3908fcddc65d ("bpf: fix lsm_cgroup build errors on esoteric configs")
---
 include/linux/bpf.h | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
include/linux/bpf.h +7 -3
index a5bf00649995..11950029284f 100644
@@ -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)
 {
Signature · 1 line
2.37.0.170.g444d1eabd0-goog
#2 lore raw
In reply to Stanislav Fomichev
This patch was applied to bpf/bpf-next.git (master) by Daniel Borkmann <[email protected]>:

Hello:

This patch was applied to bpf/bpf-next.git (master) by Daniel Borkmann <[email protected]>:

Quoted 11 lines · On Wed, 20 Jul 2022 08:52:20 -0700 you wrote:

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.

v2:
- Martin: bpf_trampoline_link_cgroup_shim should be fixed as well

Fixes 3908fcddc65d ("bpf: fix lsm_cgroup build errors on esoteric configs")

[...]

Here is the summary with links:
- [bpf-next,v2] bpf: fix bpf_trampoline_{,un}link_cgroup_shim ifdef guards

    https://git.kernel.org/bpf/bpf-next/c/9cb61fda8c71

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html